Created
August 8, 2016 22:20
-
-
Save aGuyNamedJonas/110f81784192acb15a1e5bf771e77d4b to your computer and use it in GitHub Desktop.
Iterating over an object in node.js. Can be used in conjunction with the getVariableType.js gist
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
// Source: http://stackoverflow.com/questions/684672/how-do-i-loop-through-or-enumerate-a-javascript-object | |
for (var key in p) { | |
if (p.hasOwnProperty(key)) { | |
console.log(key + " -> " + p[key]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment