Skip to content

Instantly share code, notes, and snippets.

@zmf
Created March 10, 2017 11:56
Show Gist options
  • Save zmf/a60e7f2a61c31c3be94b284dd37f7039 to your computer and use it in GitHub Desktop.
Save zmf/a60e7f2a61c31c3be94b284dd37f7039 to your computer and use it in GitHub Desktop.
walk through a JS object as it was an assoc array
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
console.log(key + " -> " + obj[key]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment