why ===
it should be ==
var array1 = [0]
if (array1 == 0 || array1.length <= 0) {
console.log(true)
} else {
console.log(false)
}
if (array1 === 0) {
console.log(true)
} else {
console.log(false)
}
3
solved having trouble with if in javascript array