JSON.parse
を2回施す。
raw = '"{\\"id\\":\\"123\\"}"'
once = JSON.parse(raw)
twice = JSON.parse(once)
console.log(twice.id) // => "123"
https://stackoverflow.com/questions/25721164/how-to-fix-an-escaped-json-string-javascript
More than 3 years have passed since last update.
JSON.parse
を2回施す。
raw = '"{\\"id\\":\\"123\\"}"'
once = JSON.parse(raw)
twice = JSON.parse(once)
console.log(twice.id) // => "123"
https://stackoverflow.com/questions/25721164/how-to-fix-an-escaped-json-string-javascript
Register as a new user and use Qiita more conveniently