JSFiddle - React, Tailwind, and code Playground
by cdaringe
JavaScript
// Open your console
// Run
// Observe logs as you would expect
// COMMENT out console.log(array.toString());
// Observe that the logged ARRAY has changes to it that technically have NOT executed yet as you'd expect
['a', 'b', 'c'].forEach(
function(item, index, array) {
console.log(item);
console.log(array);
console.log(array.toString());
array[index] = item + index;
}
);