I used the Chrome Console to write a simple statement:
console.log(4)
and received the Output:
4
undefined
What does the undefined statement mean? Does the undefined statement imply correct execution? If I execute the statement via a separate html file and then look at the console, the output is just 4.
The
undefined
is the return value ofconsole.log(...)
.You can see this by defining two functions in the console, one returning something, and the other returning nothing, e.g. like this:
And then calling them separately (manually)
and
Also note the little symbol before these return value string.
I've tested it and even with a preset variable it did not work in my Safari:
This seems to explain the bug that WebKit (engine of both Chrome and Safari) has: Link