+ 1
JAVASCRIPT calling and return
What is the difference between calling a function or return . Plz tell by a example.
1 ответ
+ 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.