Created
October 4, 2013 03:46
-
-
Save joshvermaire/6820695 to your computer and use it in GitHub Desktop.
object properties are indexed by the order in which they are added to the object
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 = {}; | |
object.b = 'b'; | |
object.a = 'a'; | |
object.c = 'c' | |
console.log(object); | |
// Object {b: "b", a: "a", c: "c"} | |
var key, item; | |
for (key in object) { | |
item = object[key]; | |
console.log(item); | |
} | |
// b | |
// a | |
// c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment