Programming with Umair

What will the following code output?
let arr = [1, 2, 3];
arr[10] = 99;
console.log(arr.length);

11 months ago | [YT] | 4



@rudranarayanboitei6332

The array length becomes 11 because assigning a value at index 10 expands the array, making its length the highest index + 1

11 months ago | 4