What about just using
!!array.length && ...?
It looks smarter and shortly.
yep, it's shorter :) use !! many years while coding on perl. now I prefer Boolean(array.length)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.