0

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?

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
Prince
  • 245
  • 4
  • 9

3 Answers3

3

Check your console log levels configuration. Chances are you unchecked info :

enter image description here

Guillaume Georges
  • 3,878
  • 3
  • 14
  • 32
-1

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

Mohaalak
  • 162
  • 1
  • 5
-2

just place your javascript.min.js file within the body tag of html and test

Govind Jha
  • 123
  • 2
  • 9