First sentence: var str = "My name is'" name "'"
Second sentence: var str = "My name is\"" name "\""
You said that only double quotes can be nested within single quotes, and only single quotes can be nested within double quotes. I can understand the first sentence, but I can't understand the second sentence because it is full of double quotes.
nearest2017-10-26 00:11:24
\ is an escape character, and the symbols following it become entity output, and there are no quotation marks here.
豆豆2017-10-25 23:43:41
"My name is\"", in fact, I want to output: My name is"
and then connect the name,
"\"", this output is",
The final output is: My name is "name",
\ is the escape character, if there is no \ in "\"", the syntax is wrong, and with \, has become escaped, you can output the "
路过2017-10-25 08:46:35
\ This is called an escape character, which means that the symbol behind it is directly output