There is a very simple technique to check whether an array is empty or not.
const arr = [];
if(arr.length === 0){
console.log("Array is empty");
}
else{
console.log("Array is not empty");
}
Get in touch with me.
Thanks!!!
@sujitkar1195
There is a very simple technique to check whether an array is empty or not.
const arr = [];
if(arr.length === 0){
console.log("Array is empty");
}
else{
console.log("Array is not empty");
}
Get in touch with me.
Thanks!!!
@sujitkar1195
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)