SyntaxFix
Write A Post
Hire A Developer
Questions
As of 2018 , You can make use of Object.getOwnPropertyNames() as described in Developer Mozilla Documentation
Object.getOwnPropertyNames()
const object1 = { a: 1, b: 2, c: 3 }; console.log(Object.getOwnPropertyNames(object1)); // expected output: Array ["a", "b", "c"]