I have a foreach loop for an array, with an index to tell me which loop i am on, and an item to tell me the value of the loop i am on. Probably an obvious answer, but I'd like to be able to get the item from the index. How might i do this?
const bar1beats = [1, 0.5, 0.5, 2]
bar1beats.forEach(foreachfunction);
function foreachfunction(item, index1){
checkitemof(index1 - 1)
}