Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to Get Object Keys and Values in JavaScript

const myObj = {
  firstName: 'John',
  lastName: 'Duo',
  address: '1270.0.0.1'
}
const keys = Object.keys(myObj); // firstName, lastName, address
const values = Object.values(myObj); // John, Duo, 127.0.0.1
 
PREVIOUS NEXT
Tagged: #How #Get #Object #Keys #Values #JavaScript
ADD COMMENT
Topic
Name
1+9 =