2
How can I acquire the number of elements that has the value of day
of 5. This would have to return me another Array, for the manipulation to become more dynamic.
This is the Array I have based on:
let arr = [
{name: "Salário", amount: 150000, day: 5},
{name: "Internet", amount: -11590, day: 10},
{name: "Teste", amount: 15000, day: 5},
]
a doubt, the reduce will go through all the elements, even if I find in the first right?
– Ricardo Pontual
@Ricardopunctual that’s right. That wasn’t the requirement of the question? "I need to know the position or index, of the elements that has the day value: 5" , then are several indices
– Cmte Cardeal
you’re right I didn’t notice it, I’ll remove the answer because it makes no sense
– Ricardo Pontual