In javascript, they have no meaning.
In the end, anything between the if bracket will be evaluated as true or false.
For all possible false values, see All false values ββin JavaScript
If you want to be more clear and explicit, use
if (arr.length > 0) { }
If you want to be less detailed, use
if (arr.length) { }
Ammarce
source share