Object.prototype.toString.call(val) == '[object Array]' ? val.some(e => e != undefined && e != null && e != '') : false;
val
is the array after the splice(0, 1)
operation. I want val.some
to return in the situation shown below. false
漂亮男人2017-05-19 10:14:26
Array.prototype.some
will skip elements with value undefined
If you need to consider undefined, you need to write a for loop to traverse it.