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

JavaScript Coding Exercise 38

Advertisement

728x90
javascript
1const props = [
2  { id: 1, name: "John" },
3  { id: 2, name: "Jack" },
4  { id: 3, name: "Tom" },
5];
6
7const [, , { name }] = props;
8
9console.log(name);

Choose the correct output:

A
Tom
B
Error
C
undefined
D
John

Advertisement

Responsive Ad
37of86