Skip to content

Instantly share code, notes, and snippets.

@joshvermaire
Created October 4, 2013 03:46
Show Gist options
  • Save joshvermaire/6820695 to your computer and use it in GitHub Desktop.
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
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