Re:How true hackers write JavaScript
by olavk on Wednesday September 05, 2018 @03:54AM
(#17915916)
It seems some of the one-liners are simply renaming JavaScript built-ins like forEach to aeach and slice to acut. Maybe this is to make it look more like the Lisp backend? But taken on its own it does not really improve readability.
[ Parent
| on HN ]
No, it is because some array-like objects like node lists actually aren't Arrays and don't have those functions in their prototype.
this is why I usually go for something like const $ = (el) => [...document.querySelectorAll(el)]