Comment convertir l'objet en tableau en javascript
// how to convert object to array in javascript
// Object.entries()
const credits = { producer: 'John', director: 'Jane', assistant: 'Peter' };
const arr = Object.entries(credits);
console.log(arr);
/** Output:
[ [ 'producer', 'John' ],
[ 'director', 'Jane' ],
[ 'assistant', 'Peter' ]
]
**/
// convert to values array
// Object.values()
console.log(Object.values(credits));
// [ 'John', 'Jane', 'Peter' ]
Chetan Nada