0

What is the difference between return and console.log?

I don’t understand

25th Mar 2020, 1:34 AM
Carlos Fornari
Carlos Fornari - avatar
4 Answers
0
thank you very much
25th Mar 2020, 2:07 AM
Carlos Fornari
Carlos Fornari - avatar
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
25th Mar 2020, 7:02 AM
Ishan Shah
Ishan Shah - avatar
0
Thank you Now I understand
25th Mar 2020, 1:30 PM
Carlos Fornari
Carlos Fornari - avatar