Javascript Object keys()
keys()
Object.prototype.keys = function() { var keys = []; $.each(this, function(key, value) { keys.push(key);//from ww w .ja v a2 s . co m }); return keys; };