Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if an array is empty javascript

if (!Array.isArray(array) || !array.length) {
  // array does not exist, is not an array, or is empty
  // ⇒ do not attempt to process array
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #array #empty #javascript
ADD COMMENT
Topic
Name
2+5 =