Created
March 10, 2017 11:56
-
-
Save zmf/a60e7f2a61c31c3be94b284dd37f7039 to your computer and use it in GitHub Desktop.
walk through a JS object as it was an assoc array
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
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