Created
March 22, 2016 00:23
-
-
Save bnoden/78d3aa14c01c42a9d126 to your computer and use it in GitHub Desktop.
Arrays and Objects in JS
This file contains 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
var object = [,,] | |
var object1 = { | |
id: "Metal Slime", | |
is: false | |
} | |
var object2 = new Object() | |
var object3 = { | |
id: "Putrid Moldyman" | |
} | |
object2.id = "Tonberry King" | |
object2['is'] = false | |
object3.is = true | |
object.push(object1) | |
object.push(object2) | |
object.push(object3) | |
for (var i in object) | |
if (object[i].is) | |
console.log(object[i].id + " is actively annoying!") | |
else console.log(object[i].id + " stopped moving!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment