1
I’m trying to run this algorithm js in order to exercise what I’ve learned, the idea was to multiply the ages by 2 and then create a filter that would remove users under the age of 50, but the algorithm find
that should go through the whole array only executes the first iteration that the condition is accepted, I do not know what the error of the algorithm
//script
const usuarios = [
{nome: 'diego', idade: 23, empresa: 'rocketseat'},
{nome: 'gabriel', idade: 15, empresa: 'rocketseat'},
{nome: 'lucas', idade: 30, empresa: 'facebook'}
];
usuarios.map(function(item){ item.idade *= 2});
const novosUsers = usuarios.find(item => item.idade <= 50);
console.log(novosUsers);
Thank you, my mistake of attention.
– etienne