0
I’d like to understand something about callbacks! I know there are other topics on the subject, but mine is a simple question and is not clear to me yet.
For example, let’s assume I have this array:
['Banana', 'Maçã', 'Melancia']
To go through the same I will use the foreach with a function and I will display with console.log
const minhaArray = ['Banana', 'Maçã', 'Melancia'];
function impri(nome, indice){
console.log(`${indice + 1}. ${nome}`);
}
minhaArray.forEach(impri);
The callback in the case, is only the function impri
or callback is all together? The function impris together from the array and foreach?