| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Errors/String_literal_EOL | [Back] [Original] |
Get to know MDN better
SyntaxError: Invalid or unexpected token (V8-based) SyntaxError: '' string literal contains an unescaped line break (Firefox) SyntaxError: Unexpected EOF (Safari)
SyntaxError
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.";
var longString = `This is a very long string which needs
to wrap across multiple lines because
otherwise my code is unreadable.`;
| Web Proxy Viewer | New URL | Original Page |