var obj = { first: 'someVal', second: 'otherVal' };
alert(Object.keys(obj)[0]); // returns 'first'
alert(Object.keys(obj)[1]); // returns 'second'
const object1 = { a: 'somestring', b: 42, c: false };
console.log(Object.keys(object1)); // expected output: Array ["a", "b", "c"]
if(!Object.keys) Object.keys = function(o){
if (o !== Object(o))
throw new TypeError('Object.keys called on non-object');
var ret=[],p;
for(p in o) if(Object.prototype.hasOwnProperty.call(o,p)) ret.push(p);
return ret;
}