[removed] The Good Parts Names/Strings railroad diagrams confusing

前端 未结 3 1158
梦毁少年i
梦毁少年i 2021-01-12 03:57

I started reading JavaScript: The Good Parts book and became confused at first pages (7 and 9 if be exact) by the railroad diagrams.

There are diagrams for the name

3条回答
  •  逝去的感伤
    2021-01-12 04:58

    JavaScript literal names may start with letters, digits, underscores, or dollar signs. However, it's a convention to use only letters as the first character. http://javascript.crockford.com/code.html

    The string literal may have any escaped character (e.g. "\"" or "\\") or any other character save the delimiter (" or ') and the backslash (\). The escaped character is not a single backslash. It's the representation of the whole escaped character. See the escaped character rail diagram in your own link.

提交回复
热议问题