Last active
October 28, 2017 11:23
-
-
Save tanyagupta/2d8a6bc12b851c25f151613aa96077eb to your computer and use it in GitHub Desktop.
Accessing heterogenous JSON data (using &&) - Part 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test_and(){ | |
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 cars){ | |
if (cars[i]["wheel"] && cars[i]["wheel"]["wheel_size"]){ | |
Logger.log(cars[i]["wheel"]["wheel_size"]) // 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