Q. What is the result?

Code:
let a = [1,2,3];
a.length = 0;
console.log(a);
  • (A) []
  • (B) [1,2,3]
  • (C) undefined
  • (D) null
πŸ’¬ Discuss
βœ… Correct Answer: (A) []
Explanation: Setting length = 0 clears the array.
Explanation by: Chandani
Setting length = 0 clears the array.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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