My question is about the array.forEach function. It has two parameters, num and i. But how does it get the values for the parameters? Somehow it magically knows that the num parameter is the value and the i parameter is the position in the array. Using the example array, it knows that num=4 & i=2 for the 3rd value in the array.
But what if you only wanted one argument? Let’s say you wanted index. if I wrote function.forEach((ind)=>{}), wouldn’t that autofill with “element”, since that’s the first one?