Computer scienceProgramming languagesJavaScriptWorking with dataArrays

Array iterating

Undefined

Report a typo

Suppose we have this array:

const arr = [1, , , 4];

In which case will we see undefined values in the console?

A)

for (let i = 0; i < arr.length; i++) {
  console.log(arr[i]);
}

B)

for (let i in arr) {
  console.log(arr[i]);
}

C)

arr.forEach((i) => console.log(i));
Select one option from the list
___

Create a free account to access the full topic