Javascript makes no distinction between single and double quoted string literals, other than which of the two should be escaped inside such a string (but that should be obvious...). This is unlike PHP, where double quoted strings can interpret variables inline.
There are three ways a character can be inserted into a string.
1. By a literal character inside the string. This is the most common way ;)
2. By an EscapeSequence, which is one of these
2.1 A backslash followed by one of these characters: ' " \ b f n r t v
2.2 An x followed by two HexDigit tokens
2.3 A u followed by four HexDigit tokens
3. By a special escape sequence called LineContiuation. This is a backslash followed by a LineTerminator.
Option 1 excludes a few characters. Specifically the backslash, one of the quotes (the same which is used to start/end the literal) and any line terminator. Any other Unicode character is accepted.
Option 2.1 replaces the backslash and the escaped character by the following table:
' = ' (\u0027)
" = " (\u0022)
\ = \ (\u005C)
b = backspace (\u0008)
f = form feed (\u000C)
n = line feed (\u000A)
r = carriage return (\u000D)
t = tab (\u0009)
v = vertical tab (\u000B)
Option 2.2 replaces the backslash and escaped sequence by the character at the Unicode point of the hexidecimal value that was escaped (2 bytes).
Option 2.3 replaces the backslash and escaped sequence by the character at the Unicode point of the hexidecimal value that was escaped (4 bytes).
Option 3 simply allows string literals like this:
"hello\
world"
Note that this does NOT make the line terminator part of the string value! The LineContinuation evaluates to an empty string.
Note that you may not use a LineTerminator literally in a string literal. It may only occur as part of a LineContinuation or an EscapeSequence (like \n and \u000A).