Open danielbayley opened 3 months ago
isDefined
is currently the opposite of isNil
, as you say. The idea is that you can do arr.filter(isNil)
, but you can't do arr.filter(!isNil)
. Some libraries would allow you to do arr.filter(not(isNil))
, but it may be nice to have something built-in.
Maybe the name could be changed, any suggestions?
Well since you can define something as null
, I would say isDefined
is the thing that might be unexpected here…
it may be nice to have something built-in. Maybe the name could be changed, any suggestions?
I’m good with isNil
, as also a Ruby fan… I think it’s opposite could be something like isntNil
—to play nice with .filter
—and then have isDefined
be !== undefined
, the opposite of isUndefined
, as mentioned. What do you think?
Should
isDefined
not actually countnull
as being defined—as in be the exact opposite ofisUndefined
? Particularly since we already haveisNil
fornull
orundefined
…