I am working with some HRV data that I have stored in Arrays in Nodejs. However, whenever I want to acces a value stored in said array it appears as "undefined". The array that I'd like to read is generated by this code:
let rr_data = [456,782,365,234,783,456,987,456,782,365,234,783,456,987,456,782,365,234,783,456,987]
let t = []
rr_data.reduce((current, next, i) => {
return t[i] = current + next
})
When I now console log "t" (console.table(t)
) it appears like this:
However, whenever I try acccesing one element by itself for example console.log(t.at(0))
or console.log(t[0])
it shows up as "undefined". Why does that happen and how can I prevent it?
Thank you for your help!