[英]JSON.parse error (Unexpected token) with escaped string
As you can see, the special characters are escaped in the string.<\/i>如您所见,特殊字符在字符串中被转义。<\/b> But it gives error.<\/i>但它给出了错误。<\/b> The error is related to description<\/strong> part<\/i>该错误与描述<\/strong>部分有关<\/b><\/p>
...Adam Goldberg delivers \"an uproarious study...
^
Doing let str = `...`
turns \"
to just "
.做
let str = `...`
把\"
变成了"
。 That's why you're getting an error.这就是你收到错误的原因。
Try let str = String.raw`...`
.试试
let str = String.raw`...`
。 Works for me为我工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.