0
I’m trying to go through an object and after that, filter the same.
I’m using this code, but it’s not working.
Someone could help me and if possible explain the code ?
const objeto = {
idade: 20,
idade:20,
idade:21};
const funcao = parametros => parametros === 20;
const funcaooriginal = objeto.forEach(funcao);
console.log(funcaooriginal);
Your object makes no sense. It has three times the same attribute with different values. Make sure you don’t have one array of objects? Something like
[{idade: 20}, {idade: 21}, ...]
?– Woss
Actually yes, it was supposed to be: and each age, have a name
– Jota
Then edit the question and enter the correct code, please.
– Woss