ES6 基础
This commit is contained in:
22
code/ES6/src/05_destructuring/03_mixed_destructuring.js
Normal file
22
code/ES6/src/05_destructuring/03_mixed_destructuring.js
Normal file
@@ -0,0 +1,22 @@
|
||||
let node = {
|
||||
type: "Identifier",
|
||||
name: "foo",
|
||||
loc: {
|
||||
start: {
|
||||
line: 1,
|
||||
column: 1
|
||||
},
|
||||
end: {
|
||||
line: 1,
|
||||
column: 4
|
||||
}
|
||||
},
|
||||
range: [0, 3]
|
||||
};
|
||||
let {
|
||||
loc: {start},
|
||||
range: [startIndex]
|
||||
} = node;
|
||||
console.log(start.line); // 1
|
||||
console.log(start.column); // 1
|
||||
console.log(startIndex); // 0
|
||||
Reference in New Issue
Block a user