JS Coding Questions Logo
JS Coding Questions
#8🎯 Exercise💻 Code

JavaScript Coding Exercise 8

Advertisement

728x90
javascript
1var array1 = new Array(3);
2
3console.log(array1);
4
5var array2 = [];
6
7array2[2] = 100;
8
9console.log(array2);
10
11var array3 = [, , ,];
12
13console.log(array3);

Choose the correct output:

A
[undefined × 3], [undefined × 2, 100], [undefined × 3]
B
[empty × 3], [empty × 2, 100], [empty × 3]
C
[null × 3], [null × 2, 100], [null × 3]
D
[], [100], []

Advertisement

Responsive Ad
8of86