2 ms·
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 h
by wiredearp 9y ago
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-switch-statement-for-better-code-5c81c044716d 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.