Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


And when you don't need any of that, how do you signal that you do not need it?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: