Show Menu
Cheatography

JSON Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Data Types

String
{ "­ani­mal­" : "­cat­" }
 
{ "­pro­mo": "Say \"Bob's the best!­\" at checkout for free 8oz bag of kibble." }
Number
{ "­wid­get­Inv­ent­ory­": 289,
 
"­sad­Sav­ing­sAc­cou­nt": 22.59,
 
"­sea­ttl­eLa­tit­ude­": 47.606209,
 
"­sea­ttl­eLo­ngi­tud­e": -122.3­32071,
 
"­ear­ths­Mas­s": 5.9721­9e+24 }
Boolean
{ "­toa­stW­ith­Bre­akf­ast­": false,
 
"­bre­adW­ith­Lun­ch": true }
Null
{ "­wat­chC­olo­r": null }
Array
{ "­car­Bra­nd":­["Fo­rd", "­BMW­"­,"Fi­at"] }
Object
{ "­nam­e":"J­ohn­"­,"ag­e:3­0,"c­ar":null }

Objects

var myObject =
{ "­fir­stN­ame­": "­Joh­n",
 
 ­ ­"­age­": 39,
 
 ­ ­"­reg­ist­ere­d": true,
 
 ­ ­"­car­": null }

Acess object properties

myObje­ct.f­ir­stName
returns "­Joh­n"
myObje­ct[­"­age­"]
returns 39
myObje­ct[2]
returns true