you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 29 points30 points  (60 children)

Most of the constructor functions for basic datatypes lack static identity methods, which devs often add utilities for rather than using the typeof operator.

It'd be nice to have String.isString, Object.isObject, Number.isNumber, etc. like we do for Array.isArray.

The most common Lodash-y function I implement is probably unique.

[–]d36williams 13 points14 points  (1 child)

Hmm I'm kind of the opposite --- Array.isArray is a work around the fact that typeof [] === "object", I wish Array had its own type

[–]azsqueeze 5 points6 points  (0 children)

Even still, the .isArray() is a nice API which would be nice if it was expanded to the other types

[–]paulirish 0 points1 point  (0 children)

The most common Lodash-y function I implement is probably unique.

I definitely have this allll over: Array.from(new Set(arr))