Aquí mi solución del ejercicio 2 de Reducer
const games = [ { nombre: 'Mario', precio: '$100', genero: 'Accion', plataforma: [['Nintendo', 'Nintendo Switch', 'Nintendo 3Ds'], ['Wii', 'Wii U']], }, { nombre: 'Zelda', precio: '$200', genero: 'Accion', plataforma: [['Nintendo', 'Nintendo Switch', 'Nintendo 3Ds'], ['Wii', 'Wii U']], }, { nombre: 'GTA', precio: '$300', genero: 'Accion', plataforma: [['XBOX360', 'XBOX-ONE'], ['PS3', 'PS4', 'PS5'], 'PC'], }, { nombre: 'Fifa', precio: '$400', genero: 'Deporte', plataforma: [['XBOX360', 'XBOX-ONE'], ['PS3', 'PS4', 'PS5'], 'PC'], }, ] const list = games.map(game => { plataforma = game.plataforma.reduce((acc, plat) => { return acc.concat(plat) }, []) return { nombre: game.nombre, plataforma } })
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Aquí mi solución del ejercicio 2 de Reducer