using key with js code example
Example 1: get keys objet javascript
var foo = {
'alpha': 'puffin',
'beta': 'beagle'
};
var keys = Object.keys(foo);
console.log(keys) // ['alpha', 'beta']
// (or maybe some other order, keys are unordered).
Example 2: js key in dict
"key" in obj // true, regardless of the actual value
Example 3: js variable for key obj
{
[yourKeyVariable]: someValueArray,
}