What would be the output? (Based on Array prototype forEach)
@Yomesh Gupta
var first = [1, , 3];
var second = [...first];
first.forEach((value, index) => {
console.log(index, value);
});
second.forEach((value, index) => {
console.log(index, value);
});
Option 1
0 1 2 3 0 1 1 undefined 2 3
Option 2
0 1 1 undefined 2 3 0 1 1 undefined 2 3
Option 3
0 1 1 3 0 1 1 3
Option 4
0 1 1 undefined 2 3 0 1 2 3