Horje
destructuring assignment in javascript Code Example
destructuring assignment in javascript
// destructuring assignment in javascript
// object destructuring
let person = { 
    name: "Chetan", 
    age: 30, 
    country: "India" 
};
const { name, age } = person;

console.log(name);
//expected output: "Chetan"

console.log(age);
//expected output: 30

console.log(country);
//expected output: Uncaught ReferenceError: country is not defined

// Array destructuring
const num = [1,2,3];
const [one, two, three] = num;
console.log(one); // 1
console.log(two); // 2
console.log(three); // 3




Javascript

Related
isogram Code Example isogram Code Example
how do i activate my mangekyou sharingan Code Example how do i activate my mangekyou sharingan Code Example
removeeventlistener not working in class javascript Code Example removeeventlistener not working in class javascript Code Example
jquery visibility effects Code Example jquery visibility effects Code Example
discord js presence update Code Example discord js presence update Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8