Search code examples
javascriptv8

JS V8 engine ignored characters


I wanted to ask, are there any characters that are completely ignored by JS engine, specifically, V8? And I know comments exist but that's not what I'm looking for.


Solution

  • V8 developer here. No, there are no such characters.

    There is a sort-of related but different feature: within string literals, you can escape the line break, like so:

    var s1 = "Hello\
    World";
    var s2 = "HelloWorld"
    console.log(s1 === s2);  // true
    

    This does not work outside string literals (like your ... = fu[...]nc(); example) though, so it's a special feature of string literal parsing, not a "character that's completely ignored by the engine".