You should be checking the .length
of that array to see if it contains any elements.
if (myCollection) // always trueif (myCollection.length) // always true when array has elementsif (myCollection.length === 0) // same as is_empty(myCollection)
You should be checking the .length
of that array to see if it contains any elements.
if (myCollection) // always trueif (myCollection.length) // always true when array has elementsif (myCollection.length === 0) // same as is_empty(myCollection)