difference between return and console.log js code example
Example: what is the difference between console.log and return
/* this is a function that return the square of the argument */
var square = function(x) {
return x * x;
}
/* we want to log in the console the value of x+(x*x)
var x = 7;
console.log(x + square(x));
/* should log 7+(7*7) => 7+49 => 56 in the console