Skip to content Skip to sidebar Skip to footer

Why Does Chrome & Firefox Console Print 'undefined'?

Take this simple Test object and paste it into the console. You'll see that it says undefined. The object is working because it also prints 123, but what is the undefined about? Te

Solution 1:

That is the return value of console.log.

Try

console.log(1);

which gives

1undefined

However, if you type just

Test.testing

that gives only

"123"

Solution 2:

undefined is the return value from the console.log call.

Post a Comment for "Why Does Chrome & Firefox Console Print 'undefined'?"