Object.keys
suggest changeObject.keys(obj) returns an array of a given object’s own enumerable string keys. Symbol keys, non-enumerable keys, and inherited keys are omitted. Integer-like keys come first, in numeric order, followed by other string keys in insertion order.
const obj = {
a: "hello",
b: "this is",
c: "javascript!"
};
const keys = Object.keys(obj);
console.log(keys); // ["a", "b", "c"]
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents