ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 92 - Certified JavaScript Developer I discussion

Report
Export

The developer wants to test the array shown: const arr = Array(5).fill(0) Which two tests are the most accurate for this array ?

Choose 2 answers:

A.
console.assert( arr.length === 5 );
Answers
A.
console.assert( arr.length === 5 );
B.
arr.forEach(elem => console.assert(elem === 0)) ;
Answers
B.
arr.forEach(elem => console.assert(elem === 0)) ;
C.
console.assert(arr[0] === 0 && arr[ arr.length] === 0);
Answers
C.
console.assert(arr[0] === 0 && arr[ arr.length] === 0);
D.
console.assert (arr.length >0);
Answers
D.
console.assert (arr.length >0);
Suggested answer: A, B
asked 23/09/2024
Lin Sun
38 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first