2024-06-24 17:15:44 +02:00
|
|
|
console.log("===================4.9 Destructuring value=====================")
|
2024-06-22 11:17:10 +02:00
|
|
|
|
2024-06-24 17:15:44 +02:00
|
|
|
console.log("an Example")
|
|
|
|
let arr = ["John", "Smith"]
|
2024-06-22 11:17:10 +02:00
|
|
|
let [firstName, surname] = arr;
|
|
|
|
console.log(firstName);
|
2024-06-24 17:15:44 +02:00
|
|
|
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]);
|