Skip to content

Commit b03339d

Browse files
author
Siyuan Gao
authored
Create exercise_07.js
1 parent 1903cfe commit b03339d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Lesson07/exercise_07.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// 1
2+
const userInfo = { name: 'John', job: 'chef', age: 34 };
3+
// 2
4+
let name, job;
5+
// 3
6+
({ name, job } = userInfo);
7+
// 4
8+
console.log(name);
9+
console.log(job);
10+
// 5
11+
const userInfo = ['John', 'chef', 34];
12+
let [ name, , age] = userInfo;
13+
console.log(name);
14+
console.log(age);
15+
// 6
16+
const userInfoObj = { name: 'John', job: 'chef', age: 34 };
17+
let { job } userInfoObj;
18+
console.log(job);

0 commit comments

Comments
 (0)