Skip to content

Instantly share code, notes, and snippets.

Created April 14, 2016 20:56
Show Gist options
  • Save anonymous/8016bbcf59fc96ae20a9c6d133cd41f1 to your computer and use it in GitHub Desktop.
Save anonymous/8016bbcf59fc96ae20a9c6d133cd41f1 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/seyake
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var cars ={
Beetle: {
color: "orange",
year: 2005
},
Camry: {
color: "purple",
year: 1998
},
Prius: {
color: "black",
year: 2014
}
};
// How would we console the object Beetle?
console.log(cars.Beetle);
// How would we console the color of the Beetle?
console.log(cars.Beetle.color);
// How would we console the year of the Prius?
console.log(cars.Prius.year);
</script>
<script id="jsbin-source-javascript" type="text/javascript">var cars ={
Beetle: {
color: "orange",
year: 2005
},
Camry: {
color: "purple",
year: 1998
},
Prius: {
color: "black",
year: 2014
}
};
// How would we console the object Beetle?
console.log(cars.Beetle);
// How would we console the color of the Beetle?
console.log(cars.Beetle.color);
// How would we console the year of the Prius?
console.log(cars.Prius.year);</script></body>
</html>
var cars ={
Beetle: {
color: "orange",
year: 2005
},
Camry: {
color: "purple",
year: 1998
},
Prius: {
color: "black",
year: 2014
}
};
// How would we console the object Beetle?
console.log(cars.Beetle);
// How would we console the color of the Beetle?
console.log(cars.Beetle.color);
// How would we console the year of the Prius?
console.log(cars.Prius.year);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment