Question PRG-JS-0007
EasyWhat is the output of this program?
console.log([10, 20, 30].length);
- A.
2
- B.
Error
- C.
Show answer and explanation
Answer: D
length gives the number of elements in an array.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
JavaScript question
What is the output of this program?
console.log([10, 20, 30].length);
2
Error
Answer: D
length gives the number of elements in an array.
undefined
3