Answers for "destructure array"

8

object destructuring

const book = {
    title: 'Ego is the Enemy',
    author: 'Ryan Holiday',
    publisher: {
        name: 'Penguin',
        type: 'private'
    }
};

const {title: bookName =  'Ego', author, name: {publisher: { name }} = book, type: {publisher: { type }} = book } = book;
Posted by: Guest on March-18-2020
0

Array Destructuring

const foo = ['one', 'two', 'three'];

const [red, yellow, green] = foo;
console.log(red); // "one"
console.log(yellow); // "two"
console.log(green); // "three"
Posted by: Guest on July-25-2021
0

array destructuring methods parameters

function foo([a, b]) {
   console.log(`param1: ${a}, param2: ${b}`);
}
Posted by: Guest on January-05-2021
0

array destructuring mdn

eslint use array destructuring
Posted by: Guest on July-02-2021

Code answers related to "destructure array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language