I would like to get the keys of a JavaScript object as an array, either in jQuery or pure JavaScript.
Is there a less verbose way than this?
var foo
You can use jQuery's $.map.
var foo = { 'alpha' : 'puffin', 'beta' : 'beagle' }, keys = $.map(foo, function(v, i){ return i; });