Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the "less than dot" symbol mean in Chrome console output?

Sometimes, but not always, when the result of an evaluation in the Chrome JavaScript console results in "undefined", there is a symbol in the left margin that looks like a less-than symbol with a dot.

Examples can be seen in this section of the Chrome developer's tools documentation.

But what that symbol means does not appear to ever be explained. Does anybody know what it's trying to convey? Thanks.

like image 791
Marty Kiker Avatar asked Feb 05 '13 17:02

Marty Kiker


People also ask

What is $$ in chrome console?

$ is an alias for document. querySelector . In the same vein there is $$ which is an alias for document.

How do I see console output in Chrome?

Console Logs in Chrome: In Google Chrome, the Console Logs are available as a part of Chrome Dev Tools. To open the dedicated Console panel, either: Press Ctrl + Shift + J (Windows / Linux) or Cmd + Opt + J (Mac).

What is VM in Chrome console?

It is abbreviation of the phrase Virtual Machine. In the Chrome JavaScript engine (called V8) each script has its own script ID. Sometimes V8 has no information about the file name of a script, for example in the case of an eval .


1 Answers

Whenever a set of function runs on the command line, the last line of console output is always the returned value of the last operation in the input. The symbol calls out the return value of a function when there has been console output since the start of the command execution. This is to avoid confusion in a case like this:

function logVar(someVar) {
    console.log(someVar);
}

When you run logVar on the console, it outputs the value of someVar. However, the return value of logVar is also logged (here, undefined). It's helpful to have the return value visually distinguished from the logged variable, so you don't look at the last line of the output and wonder, "Why is my variable undefined?".

like image 115
apsillers Avatar answered Sep 27 '22 16:09

apsillers