Created
January 6, 2014 13:20
-
-
Save unknownuser88/8282794 to your computer and use it in GitHub Desktop.
return obj keys
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
//return obj keys | |
$.extend({ | |
keys: function(obj){ | |
var a = []; | |
$.each(obj, function(k){ a.push(k) }); | |
return a; | |
}, | |
eys: function(obj){ | |
return 'test'; | |
} | |
}) | |
// Usage: | |
var obj = {a: 1, b: 2, c: 3, d: 4, jquery: 'noob'} | |
console.log($.eys(obj)); // a,b,c,d,jquery |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment