Every time console.log is executed, a line saying undefined is appended to the output log.
It happens in both Firefox and Chrome on Windows and Linux.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re running
console.log()from a JS file, thisundefinedline should not be appended.If you’re running
console.log()from the console itself, it makes sense. This is why: In the console you can type a name of a variable (for example try typingwindow) and it prints info about it. When you run any void function (like console.log) from the console, it also prints out info about the return value,undefinedin this case.I tested both cases on my Chrome (Mac ver 23.0.1271.101) and indeed I see the
undefinedline when I run it inside the console. Thisundefinedalso appears when I write this line in the console:var bla = "sdfdfs"