5.9
This commit is contained in:
parent
c797db0f36
commit
1ba1f5f44b
@ -1,5 +1,11 @@
|
|||||||
let arr = ["John", "Smith"]
|
console.log("===================4.9 Destructuring value=====================")
|
||||||
|
|
||||||
|
console.log("an Example")
|
||||||
|
let arr = ["John", "Smith"]
|
||||||
let [firstName, surname] = arr;
|
let [firstName, surname] = arr;
|
||||||
console.log(firstName);
|
console.log(firstName);
|
||||||
console.log(surname);
|
console.log(surname);
|
||||||
|
|
||||||
|
console.log("can be used in any iterable variables, like set, string")
|
||||||
|
let [a,b,c] = "abc";
|
||||||
|
let [one, two, three] = new Set([1, 2, 3]);
|
Loading…
Reference in New Issue
Block a user