JAVASCRIPT calling and return | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

JAVASCRIPT calling and return

What is the difference between calling a function or return . Plz tell by a example.

9th May 2021, 5:29 PM
Aurosish dev
Aurosish dev - avatar
1 Answer
+ 2
You can think of a function like a person who does a specific task. A function may (or not) accept stuffs necessary to do its work, stuffs that diversify the resulting product in specific ways. We call these stuffs parameters. A function may (or not) return something to the caller once its work is done. The caller will be responsible to prepare something, into which the product returned by a function will be stored. There is a chapter dedicated to cover functions in the course, you'll find examples there.
9th May 2021, 8:26 PM
Ipang