About JSON.parse?

var str = "a="""

var res = "{"" + str.replace(/"/g, "\\"").replace(/=/g, "":"") + ""}"

console.log("res", res) // {"a":"\"\""}
// 1:res?

console.log(res === "{"a":"\"\""}") // false
// 2:false

console.log("res1", JSON.parse(res)) // {a: """"}
What are the parsing rules for

question 3:JSON.parse ()?

Feb.10,2022

JSON.parse (jsonData) , jsonData is a string in JSON format, which serializes the string in JSON format into JSON data.


this is actually a problem of escaping single quotation marks and double quotation marks in a string. The "in
res is actually escaped, and there is no'


he parses the json string into a json object.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bb3b-2c2cc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bb3b-2c2cc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?