3 ms·
const add = ({ a, b }) => a + b; const _add = ({ a, b }) => b + a;
by benburton 6y ago
const add = ({ a, b }) => a + b;
const _add = ({ a, b }) => b + a;
- valenterry 6y agoThat one is rather simple to break. console.log(add({a:"1", b:2})) //12 console.log(_add({a:"1", b:2})) //21 So to make the code break with the change to _add, I can just do: if(add({a:"1", b:2}) != 12) boom()
- benburton 6y agoAh of course!