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

JavaScript Coding Exercise 35

Advertisement

728x90
javascript
1const [x, ...y, z] = [1, 2, 3, 4];
2
3console.log(x, y, z);

Choose the correct output:

A
1, [2, 3], 4
B
1, [2, 3, 4], undefined
C
1, [2], 3
D
SyntaxError

Advertisement

Responsive Ad
34of86