Skip to content

Instantly share code, notes, and snippets.

@aGuyNamedJonas
Created August 8, 2016 22:20
Show Gist options
  • Save aGuyNamedJonas/110f81784192acb15a1e5bf771e77d4b to your computer and use it in GitHub Desktop.
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
// 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