myobj[Object.keys(myobj)[0]];
//To get an object's key by index, call the Object. keys() method
//to get an array of the objects keys and use bracket notation
//to access the key at the specific index, e.g. Object. keys(obj)[1] .
myobj[Object.keys(myobj)[0]];
var obj = {
dog: "woof",
cat: "meow",
key: function(n) {
return this[Object.keys(this)[n]];
}
};
obj.key(1); // "meow"