Similar to something I posted recently but not the same :-)
I'm trying to test in GAS if an array contains any empty values. includes() doesn't seem to be supported so I've been trying to use index but failing miserably. My test code is below with the empty element before 7
var e = [1,2,3,4,2,4,,7];
var x = 0;
if (e.indexOf() ==-1){
var x = 'No blanks';
}
But no matter what I try it always passes. I've already tried indexOf(""), indexOf('') & indexOf().
I've run out of things to try so any help would be greatly received!
Array#pushinstead of assigning with the bracket operator and an index. i.e.if (val !== undefined) {myArr.push(val)}