What is the difference b/n console.log and return

console.log is function that logs passed in argument to console.
return is keyword, which part of the return statement, used to end function execution. Once line with it is executed, the function is exited and function returns whatever is defined in the return statement. No matter ie. if after the return was additional lines with code, or if return was within loop.

1 Like