3 ms·
You still have to simulate named arguments with an object: const foo = ({ a = 2, b = 2, c = 3 } = {}) => a * b * c; const dict = {b: 4, c: 6}; foo
by moretti 11y ago
You still have to simulate named arguments with an object:
const foo = ({ a = 2, b = 2, c = 3 } = {}) => a * b * c;
const dict = {b: 4, c: 6};
foo(); // 12
foo(dict); // 48