0
What is the difference between return and console.log?
I donât understand
4 Answers
0
thank you very much
0
Console.log is used to print information to the console accessible by inspect of the browser.
Return is used to execution of a function and return the some value
return will return a value when the function is called.
function hello(){
console.log('Hello');
}
hello();
This will print Hello in the console.
function hello(){
return 1;
}
var a= hello();
console.log(a);
1 will be stored in the variable a.
This will print 1 in the console.
console is store the output of a code
0
Thank you Now I understand