Skip to content

Instantly share code, notes, and snippets.

@msure
Created October 26, 2016 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msure/2b33257e6efa88c49c652e82702be503 to your computer and use it in GitHub Desktop.
Save msure/2b33257e6efa88c49c652e82702be503 to your computer and use it in GitHub Desktop.
Iterate Through An Objects Key-Value Pairs In Javascript: The Unnecessarily Complicated One-Liner Edition
var vals = {'one':1,'two':2};
Object.keys(vals).forEach(function(i) {console.log('key:' + i + ', value:' + vals[i]);});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment