// Deconstruct , IIFE, Closures, Modules /*Deconstruct : to get a specific number of items from an array or an object instead of assigning one by one to a variables */ // const items = ["apple", "banana", "carrot"]; // const [apple, banana, ...rest] = items; // console.log(apple); // // ... is more like spread/rest operator. we can use it for deontructing and spreading // // in the below case, we can add 'more banana' // const newItems = [...items, "more banan"]; // const user = { // name: "kam", // photos: ["khan", "youtube"], // analytics: { // subscribers: 1000, // age: 50, // }, // }; // // const photos = user.photos; // const { photos, age } = user; // /* IIFE : immediately invoked function expression // automatically invoked. better use is libraries // */ // function hello() { // console.log("hello"); // } // hello(); // //iffe // (function hello() { // console.log("hello"); // })();