Type conversion problem

{name: ,sex: ,age: 20}

how to convert an entire object to an array using ES6:

[0:{name: ,sex: ,age: 20}]

there may be more than one object here, that is, {}, {} = > [0: {}, 1: {}].

Mar.16,2021

where are the objects you need to convert stored? Isn't it in the array? push just go in, it's not very clear about the specific scenario of this problem


your example has only one message, and you can't see what needs to be done.

Menu