1var foo = {
2 'alpha': 'puffin',
3 'beta': 'beagle'
4};
5
6var keys = Object.keys(foo);
7console.log(keys) // ['alpha', 'beta']
8// (or maybe some other order, keys are unordered).
1const object1 = {
2 a: 'somestring',
3 b: 42,
4 c: false
5};
6
7console.log(Object.keys(object1));
8// expected output: Array ["a", "b", "c"]
1const object = { a: 5, b: 6, c: 7 };
2const picked = (({ a, c }) => ({ a, c }))(object);
3
4console.log(picked); // { a: 5, c: 7 }
1var myObj = {no:'u',my:'sql'}
2var keys = Object.keys(myObj);//returnes the array ['no','my'];
1const object1 = {
2 a: 'somestring',
3 b: 42,
4 c: false
5};
6
7console.log(Object.keys(object1));
8