how to get the key value of an object in javascript dynamically code example
Example: how to use variable in js key
ES6 defines ComputedPropertyName
var thetop = "top",
obj = { [thetop]: 10 };
console.log(obj.top); // -> 10
ES6 defines ComputedPropertyName
var thetop = "top",
obj = { [thetop]: 10 };
console.log(obj.top); // -> 10