I would like to ensure that an array contains more then one element and that it is not null nor undefined. With other words: I am looking for an alternative to
if(array && array.length > 1)
that would be better to read.
Lodash provides a method for checking if an array contains at least one element:
if(_.some(array))
Is there a similar method for checking for several elements?
Unfortunately following methods do not exist:
if(_.several(array))
if(_.many(array))
Would I have to write my own extension method or did I just not find the right lodash command, yet?