SyntaxError: Invalid or unexpected token (V8-based) SyntaxError: '' string literal contains an unescaped line break (Firefox) SyntaxError: Unexpected EOF (Safari)é误类å åªéåºéäºï¼
æå¤ js è§£æå符串åºéãåç¬¦ä¸²å¿ é¡»ä½¿ç¨åå¼å·æåå¼å·æ¥æ£ç¡®çå ³éãå¨ Javascript ä¸ä½¿ç¨åå¼å·çå符ååå¼å·çåç¬¦ä¸²æ¯æ²¡æåºå«çãå符串ç¨è½¬ä¹åç¬¦ä¸æ¯åå¼å·å°±æ¯åå¼ã为解å³è¿ä¸ªéè¯¯ï¼æ£æ¥ä¸ä¸ï¼
å¨ javascript ä¸ä½ ä¸è½å¤ç´æ¥ä½¿ç¨å¤è¡å符串èµå¼ç»ä¸ä¸ªåéãå¦ä¸ï¼
var longString = "This is a very long string which needs
to wrap across multiple lines because
otherwise my code is unreadable.";
// SyntaxError: unterminated string literal
å¯ä»¥ä½¿ç¨"+"è¿ç®ç¬¦ï¼åææ ï¼ææ¨¡æ¿å符串æ¥ä»£æ¿å¤è¡ãâ+âè¿ç®ç¬¦ç使ç¨å¦ä¸ï¼
var longString =
"This is a very long string which needs " +
"to wrap across multiple lines because " +
"otherwise my code is unreadable.";
æè ä½ å¯ä»¥ä½¿ç¨â\â卿¯ä¸è¡çæ«å°¾ï¼ä»¥è¡¨ç¤ºè¯¥å符串å¨ä¸ä¸è¡ç»§ç»ãè¦ç¡®ä¿â\âä¹åæ²¡ææ²¡æç©ºæ ¼åä»»ä½å ¶ä»çå符ï¼å缩è¿ï¼å¦å该â\âå°ä¸ä¼èµ·ä½ç¨ãä½¿ç¨æ¹æ³å¦ä¸ï¼
var longString =
"This is a very long string which needs \
to wrap across multiple lines because \
otherwise my code is unreadable.";
å¦ä¸ç§æ¹å¼æ¯ä½¿ç¨ ES 2015 çç¯å¢ææ¯ææ¨¡æ¿å符串ï¼åå¼å·` `ï¼ã
var longString = `This is a very long string which needs
to wrap across multiple lines because
otherwise my code is unreadable.`;
ç¸å
³
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4