SyntaxFix
Write A Post
Hire A Developer
Questions
One could also use the JQuery filter for objects
var newobj = $(obj).filter(function(key) { return $(this)[key]!== undefined; })[0];
Demo here