《小紅書 第20章》web
JSON (JavaScript Object Notation) is most widely used data format for data interchange on the web. This data interchange can happen between two computers applications at different geographical locations or running within same hardware machine.編程
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.json
`借用JS語法 JSON is a strict subset of JavaScript, making use of several patterns found in JavaScript to represent structured data.網絡
JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured types (objects and arrays).app
There was a time when XML was the de facto standard for transmitting structured data over the Internet. The fi rst iteration of web services was largely XML-based, highlighting its target of server-to-server communication.ide
JSON syntax allows the representation of three types of values:orm
Simple Values — Strings, numbers, Booleans, and null can all be represented in JSON using the same syntax as JavaScript. The special value undefined is not supported. 某一簡單「數據」:單一名值對,數據有名字(key)和數據值(value),使用冒號(:)分隔server
Objects — The fi rst complex data type, objects represent ordered key-value pairs. Each value may be a primitive type or a complex type. 非線性的名值組合(多個名值對) 多個(類型)不一樣的數據的「獨立組合」 使用花括號({})對象
Arrays — The second complex data type, arrays represent an ordered list of values that are accessible via a numeric index. The values may be of any type, including simple values, objects, and even other arrays. 線性的名值組合(多個名值對) 多個(類型)相同的數據的「獨立組合」 使用方括號([])接口
JSON exists as a string — useful when you want to transmit data across a network. It needs to be converted to a native JavaScript object when you want to access the data. This is not a big issue — JavaScript provides a global JSON object that has methods available for converting between the two.