JSON Cheat Sheet: by Via
JSON Cheat Sheet: by Via
true;
myObject.sex returns "male" myArray[0] returns { "fist": "John", "last":
array var sequence of myObject["age"] returns 39 "Doe" ... }
myArray comma-separated myArray[1] returns { "fist": "Jane", "last":
myObject[0] returns "John"
= [ "a", values (any data "Smith" ... }
"b", "c", type); enclosed in myObject.something returns undefined
myArray[1].first returns "Jane"
"d" ]; square brackets myObject[6] returns undefined
myArray[1][2] returns 42
object var unordered collection of
myObject comma-separated Array of objects myArray[2].regi returns false
= { "id": 7 key/value pairs; stered
var myArray = [
}; enclosed in curly myArray[3] returns undefined
braces; properties {
myArray[3].sex error: "cannot read
(keys) are distinct "first": "John",
property..."
strings "last": "Doe",
cheatography.com/mackan90096/
JSON Cheat Sheet
by Mackan90096 (Mackan90096) via cheatography.com/20748/cs/3634/
"last": 1, .ref.last]
"sex": 3, ect.ref.age]
"salary": 4,
"registered": 5
},
"jdoe1": [
"John",
"Doe",
39,
"male",
70000,
true
],
"jsmith1": [
"Jane",
"Smith",
42,
"female",
80000,
true
]
};
cheatography.com/mackan90096/