I'm trying to find if there's a null value in my array without using for loops, mainly something similar to Array.indexOf. Undefined is NOT a string, it's a null value that comes up as undefined when I use console.log(ARRPREFIX)
var arr = ["**", undefined, null];
if (arr.indexOf(null) > -1) {
console.log("Should be null");
arr.splice(arr.indexOf(null), 1);
}
Above is my code, however it doesn't detect the undefined value, I also tried putting in "undefined" instead but that doesn't work.
null≠undefined≠"undefined"undefined. It's as far from undefined as undefined can bearr.filter(Boolean)It should remove falsy values