Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const arr = [];
- const arr2 = [1];
- console.log(!arr.length); // true - check if array empty
- console.log(!!arr.length); // false - check if array is NOT empty
- console.log(!arr2.length); // false
- console.log(!!arr2.length); // true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement