ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Object.keys()
    Study/JavaScript 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"]
    

    'Study > JavaScript' 카테고리의 다른 글

    Inheritance I  (0) 2020.05.08
    Method Calls  (0) 2020.05.08
    Setters  (0) 2020.05.07
    getter와 setter 차이점  (0) 2020.05.07
    Getters  (0) 2020.05.06

    댓글

Designed by Tistory.