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

It's however easy to read and that feels good if not right, since the common solutions to this imagined problem require substantial mental overhead as seen on https://hackernoon.com/rethinking-javascript-eliminate-the-s.... To promote "single functions" we could:

  handleEvent(e) {
    this[e.type](e, e.target);
  }
  mousemove(e, elm) {
    elm.style.left = e.clientX + 'px';
  }
... but then the discussion would almost certainly revolve around this questionable decision instead of the original topic.


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

Search: