3 ms·
Many reasons. 1) Hoisting + mutability a = 'lol'; function a() {} a() // error 2) one-liners const findByName = (list, name) => list.find(item => it
by lhorie 7y ago
Many reasons.
1) Hoisting + mutability
a = 'lol';
function a() {}
a() // error
2) one-liners
const findByName = (list, name) => list.find(item => item.name === name);
//vs
function findByName(list, name) {
return list.find(item => item.name === name);
}
3) signaling that `this` keyword usage should not happen
- orange8 7y agoAnd when you don't need any of that, how do you signal that you do not need it?