This is because console.log()
does not return a value (i.e. returns undefined). The result of whatever you entered to the console is first printed to the console, then a bit later the message from console.log
reaches the console and is printed as well.
If a browser does not show the undefined, it means it has noticed that your console input only prints to the console, and so skips showing the result.