When I try to print a simple string with console.log(), it does not print the string out but rather it returns undefined:
> console.log("Hello")
< undefined
What is wrong?
When I try to print a simple string with console.log(), it does not print the string out but rather it returns undefined:
> console.log("Hello")
< undefined
What is wrong?
because when you write in console it will print the return value of the function, when the function you called have no explicit return javascript implicitly call return undefined.
so when you write console.log("hello")
it will return undefined so console print undefined for you