Q. What will be printed?

Code:
let a = [1, 2];
a[10] = 99;
console.log(a.length);
  • (A) 2
  • (B) 11
  • (C) 10
  • (D) 12
πŸ’¬ Discuss
βœ… Correct Answer: (B) 11
Explanation: Setting index 10 makes the array length 11.
Explanation by: Chandani
Setting index 10 makes the array length 11.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
77
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
92%
Success Rate