Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get all the properties of a object in javascript

const user = {
    name: 'Alex',
    age: 30
};

const props = Object.keys(user);

console.log(props); // [ 'name', 'age' ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #properties #object #javascript
ADD COMMENT
Topic
Name
2+5 =