and Array#isEmpty is still not there
https://twitter.com/mathias/status/1090380500739506176 …
-
-
By using .length we reveal Array's implementation details (so I can't interchange this object with a different type of collection), it also involves two operations instead of one. Honestly I don't know why JS is not considering it, almost every OOP lang has a method for this
-
By adding it to Array.prototype as you suggest, it’d similarly be tricky to use it with a different type of collection.
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.
New JavaScript features in ES2019:
Array#{flat,flatMap}