Parameter metode destrukturisasi array
const items = [ ['foo', 3], ['bar', 9] ];
items.forEach(([word, count]) => {
console.log(word+' '+count);
});
Nutty Narwhal
const items = [ ['foo', 3], ['bar', 9] ];
items.forEach(([word, count]) => {
console.log(word+' '+count);
});
function foo([a, b]) {
console.log(`param1: ${a}, param2: ${b}`);
}