Study/JavaScript
Object.keys()
더 멋진 세상을 꿈꾸는 개발자
2020. 5. 8. 09:30
The Object.keys() method returns an array of a given object's own enumerable property names, iterated in the same order that a normal loop would.
Object.keys() returns an array whose elements are strings corresponding to the enumerable properties found directly upon object. The ordering of the properties is the same as that given by looping over the properties of the object manually.
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.keys(object1));
// expected output: Array ["a", "b", "c"]