Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to access key of object in javascript

const object1 = { a: 'somestring', b: 42, c: false };

console.log(Object.keys(object1)); // expected output: Array ["a", "b", "c"]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #access #key #object #javascript
ADD COMMENT
Topic
Name
1+2 =