Skip to content

Instantly share code, notes, and snippets.

@tanyagupta
Last active November 4, 2016 17:17
Show Gist options
  • Save tanyagupta/3c8ea43ca87a8dba648d7a67867c6f3c to your computer and use it in GitHub Desktop.
Save tanyagupta/3c8ea43ca87a8dba648d7a67867c6f3c to your computer and use it in GitHub Desktop.
Accessing heterogenous JSON data (using or) - Part 3
function test_or(){
var cars=[
{make: "Jeep",model: "Cherokee",trim:"Sport 4dr Front-wheel Drive",year:"2016",
wheel:{wheel_size:"17 x 7.5",wheel_metal:"Aluminum"}},
{make: "Jeep",model: "Wrangler",trim:"Sahara 2dr 4x4",year: "2015"}
]
for (var i in basic){
Logger.log(cars[i]["wheel"] || "") // Logger.log() is Google App Script's console.log
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment