How to get an array containing all the object property values in JavaScript

1 Answer

0 votes
const user = {
  id: 928737,
  name: 'Rose'
};
 
 
console.log(Object.values(user)); 
 
 
/*
run:
   
Array [ 928737, "Rose" ]
 
*/

 



answered Nov 8, 2019 by avibootz
edited Apr 1, 2024 by avibootz
...