const{}=
/*The destructuring assignment syntax is a JavaScript expression that
makes it possible to unpack values from arrays, or properties from objects,
into distinct variables.*/
let array = [2,3];
[a,b] = array;// unpacking array into var a and b
console.log(a); //output 2
console.log(b); //output 3
let object = {name:"someone",weight:"500pounds"};
let {name,weight} = object; // unpacking object into var name and weight
console.log(name);// output someone
console.log(weight);//output 500pounds
//it i similar as doing this
/*
var a = array[0];
var b = array[1]
var name = object.name;
var weight = object.weight;
*/
Also in JavaScript:
- show hand icon on hover javascript
- jquery datepicker no past dates
- how to trigger an event on reload js
- commands discord.js
- captitalize js
- node load file
- event listener to elements with class
- onchange value in hidden input
- javascript how to get every element after the 1st in an array
- react spring
- react native get location
- what foreach method returns in javascript
- javascript remove the current tr with click
- angular add object to array
- nodejs cache data
- react useref in useeffect
- js method string remove extra spaces
- convert number to array javascript
- convert json into map in java example
- delete backspace on string js
- what are dependencies in package.json
- javascript destructing
- how to call function on every keypress in jquery
- js find intersection point