Answers for "check for empty array javascript\"

24

javascript check if array is empty

if (typeof array !== 'undefined' && array.length === 0) {
    // the array is defined and has no elements
}
Posted by: Guest on March-13-2020
0

empty array js

let list = [1, 2, 3, 4];
function empty() {
    //empty your array
    list.length = 0;
}
empty();
Posted by: Guest on June-01-2020

Code answers related to "check for empty array javascript\"

Code answers related to "Javascript"

Browse Popular Code Answers by Language