The content about JSON is used in the work

Time:2020-7-28

The relationship between JSON and JS objects

Many people don’t understand the relationship between JSON and JS objects, even who is who. In fact, it can be understood as follows:

JSON is a string representation of JS objects. It uses text to represent the information of a JS object,It’s essentially a string.

JSON to object
var obj = JSON.parse('{"a": "Hello", "b": "World"}'); 
//The result is {A: 'hello', B: 'world'}
Object to JSON
var json = JSON.stringify({a: 'Hello', b: 'World'});
//The result is' {"a": "hello", "B": "world"} '

Recommended Today

Ansible quick start

What is ansible? Ansible is a configuration management and configuration tool. It uses SSH to connect to the server and run the configured tasks. SSH only needs to be enabled on the server, and ansible on the client side is responsible for all work. When we need batch deployment, we can write our own scripts, […]