Created
September 12, 2012 10:33
-
-
Save hisaos/3705827 to your computer and use it in GitHub Desktop.
JS Object.keys()
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 obj = {"a":1, "b":2, "c":3 }; | |
Object.keys(obj); // this will return a list of keys in obj | |
for (var k in obj) | |
{ | |
// this will iterate over the keys in obj | |
process.stdout.write(k); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment