javascript-learner/5.9Destructuring/t.js
2024-06-24 17:15:46 +02:00

11 lines
348 B
JavaScript

console.log("===================4.9 Destructuring value=====================")
console.log("an Example")
let arr = ["John", "Smith"]
let [firstName, surname] = arr;
console.log(firstName);
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]);