Answers for "javascript function arguments array destructuring"

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 methods parameters

const items = [ ['foo', 3], ['bar', 9] ];
items.forEach(([word, count]) => {
    console.log(word+' '+count);
});
Posted by: Guest on January-05-2021

Code answers related to "javascript function arguments array destructuring"

Code answers related to "Javascript"

Browse Popular Code Answers by Language