


Introduction to the use of JSON.parse() and JSON.stringify()_javascript skills
May 16, 2016 pm 04:43 PMparse is used to parse a json object from a string, such as
var str = '{"name":"huangxiaojian","age":"23"}'
Result:
JSON.parse(str) Object age: "23" name: "huangxiaojian" __proto__: Object
Note: Single quotation marks are written outside {}, and each attribute name must use double quotation marks, otherwise an exception will be thrown.
stringify() is used to parse a string from an object, such as
var a = {a:1,b:2}
Result:
JSON.stringify(a) "{"a":1,"b":2}"

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Combination of golang WebSocket and JSON: realizing data transmission and parsing

What is the difference between MySQL5.7 and MySQL8.0?

How to exclude a field from JSON using @Expose annotation in Java?

Performance optimization tips for converting PHP arrays to JSON

Pandas usage tutorial: Quick start for reading JSON files

Use the json.MarshalIndent function in golang to convert the structure into a formatted JSON string

How do annotations in the Jackson library control JSON serialization and deserialization?

How to handle XML and JSON data formats in C# development
