So, I’m a bit confused.
How does the program known what “i” and “num” represent and how to use them?
It feels like the program assumes “i” is the index of each item in the array and “num” is the value, but I wonder how that is.
const updateUI = (array = []) => {
array.forEach((num, i) => {
const outputValueNode = document.getElementById(`output-value-${i}`);
outputValueNode.innerText = num;
})
}