can someone explane how foreach parameters work ,i mean if they are local variables they should still be assigned to a value
what i mean is how can foreach method know that num is number and i is the index
const updateUI = (array = []) => {
array.forEach((num, i) => {
const outputValueNode = document.getElementById(`output-value-${i}`);
outputValueNode.innerText = num;
})
}