Answers for "escaped json to json javascript"

0

escaped json to json javascript

twice_json = '"{\\"orderId\\":\\"123\\"}"'  // (ingore the extra slashes)
json = JSON.parse(twice_json)               // => '{"orderId":"123"}'
obj = JSON.parse(json)                      // => {orderId: "123"}
obj.orderId                                 // => "123"
Posted by: Guest on December-24-2020

Code answers related to "escaped json to json javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language