// JavaScript Destructuring
// let [a,b] = [34,35]
// console.log(a,b);
// [a,b,c,d,...e] = [1,2,3,4,5,6,7,8,9,45,3,53,4,343,2,42,3432]
// console.log(a);
// console.log(b);
// console.log(e);
// ({a,b,c,...d} = {a:4, b:6, c:4,d:8,e:2,f:1})
// console.log(a,b,c,d);
// object destrcuturing
const laptop = {
model : "HP notenook",
ram : '8 GB',
ssd : '1 TB',
warranty : '2yrs',
videomemory : 32,
start : function(){console.log("latop started")}
}
const { model, ram, ssd, videomemory, start } = laptop;
console.log(model, ram, ssd, videomemory, start);
0 Comments