What is the difference between:
function bla1(x){console.log(x)}
and
function bla(x){return console.log(x)}
I
Return in a function is a way to pass back data from the function.
Example:
function test(){
var test = 1+1;
return test;
}
var feedback = test(); //feedback would now contain the value 2 if outputted.
We could also send a variable into the function and then return it back out.
Example 2:
function test(i){
i= i+1;
return i;
}
var feedback = test(1); //feedback would also output the value 2.