Skip to content

Instantly share code, notes, and snippets.

@darmentrout
Last active April 3, 2019 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darmentrout/4164c9ff64971ddbd102fa4cf268ad3b to your computer and use it in GitHub Desktop.
Save darmentrout/4164c9ff64971ddbd102fa4cf268ad3b to your computer and use it in GitHub Desktop.
This is a stupid joke based on a song from 1996.
var cars = {
"acura": {
"color": "blue",
"year": 2009
},
"buick": {
"color": "gray",
"year": 2010
},
"chevy": {
"color": "white",
"year": 2013
},
"datsun": {
"color": "blue",
"year": 1972
},
"fiat": {
"color": "yellow",
"year": 2010
},
"hudson": {
"color": "blue",
"year": 1950
}
}
var blue_cars = 0;
Object.keys(cars).forEach(function(car){
if( cars[car].color == 'blue' ){
blue_cars++;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment