Created
October 22, 2014 10:07
-
-
Save swapnilshrikhande/62bc3b17a614aec1b58b to your computer and use it in GitHub Desktop.
javascript get all keys for an object.
This file contains hidden or 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 util = util || {}; | |
util.getKeys = function (obj) { | |
var r = [] | |
for (var k in obj) { | |
if (!obj.hasOwnProperty(k)) | |
continue | |
r.push(k) | |
} | |
return r; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment