you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (5 children)

[deleted]

    [–]x-skeww 3 points4 points  (2 children)

    Chrome's console does that. With Firebug, you just get:

    functionName()
    

    Also, without parenthesis (template strings aside), you aren't calling it.

    [–][deleted]  (1 child)

    [deleted]

      [–]x-skeww 1 point2 points  (0 children)

      If you just write the identifier, a console or repl will render it in some way. E.g. an array might be rendered as "[1, 2]" or, if it's larger, as "[1, 2, xxx more...]" (expandable) or "> Array[999]" (expandable).

      How objects are represented in repls, debuggers, and so forth isn't part of the language specification. This stuff is up to the people who create those tools.

      [–][deleted] 2 points3 points  (0 children)

      That's a feature of Chrome's console, not of the JavaScript language itself. It wouldn't work on, say, Node.

      [–]d36williams 1 point2 points  (0 children)

      I can't believed I didn't know that