The standard way to parse JSON in JavaScript is JSON.parse()
The JSON
API was introduced with ES5 (2011) and has since been implemented in >99% of browsers by market share, and Node.js. Its usage is simple:
const json = '{ "fruit": "pineapple", "fingers": 10 }';
const obj = JSON.parse(json);
console.log(obj.fruit, obj.fingers);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…