Created
March 21, 2022 09:37
-
-
Save rashid327/bc53cf2767a39d5b395cb030bfa24bf6 to your computer and use it in GitHub Desktop.
Object to Array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const person = [{ | |
firstName: 'John', | |
lastName: 'Doe' | |
}, | |
{ | |
firstName: 'John', | |
lastName: 'Doe' | |
}]; | |
var propertyValues = [];//Object.values(person[0]); | |
for (let i = 0; i < person.length; i++) { | |
propertyValues.push(Object.values(person[i])); | |
} | |
console.log(propertyValues); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment