Created
October 26, 2016 22:32
-
-
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
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
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