-2
Hello, I’m doubtful on how to count the values found inside an array, which is in an object. Thanks for your help.
let spendin={
recipes:[2000,5000,400],
expenses:[8000]
}
function saldo(spendin){
let x=0
let limitex=spendin.recipes.length()
let limitey=spendin.expenses.length()
console.log(limitex)
let somax,somay
for(x=0;x<=limitex;x++){
somax+=spendin.recipes[x]
}
for(x=0;x<=limitey;x++){
somay+=spendin.recipes[x]
}
return somax-somay
}
It was exactly that, sorry for the confusing question, I’m starting now, I’m quite lost yet, but thank you so much for the answer
– João Lucas Mendes de Oliveira
Don’t apologize for asking :) Seeking knowledge is always important. Good luck in your learning
– Tramonta