1:
var sum = function (a, b){ return a+b; }
2:
var sum = function (a, b, callback ){ console.log(a+b); callback; }
I am trying to understand callback functions but I am not what is the key differences here ?
One returns the result of adding (or concatenating) a
and b
.
The other logs that to the console instead of returning anything.
The callback
variable isn't used. It is just mentioned, but that does nothing. It might as well not be there.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments