0

I need to add tim@wekeycars.com to the if(newPart[l][0] != 'kurt@metrolockdm.com') so that both are excluded from the array generated by the for loop.

Correct me if I am wrong, but I thought I read somewhere that var can be used to to hold the 2 conditions, but I can't seem to make it work.

 for(var l = 2; l<newPart.length;l++){
    if(newPart[l][1] == 'New Item/Special Order'){
      if(newPart[l][0] != 'kurt@metrolockdm.com'){
        if(newPart[l][7] == ''){
        dsmSO.push([newPart[l][0],newPart[l][6]])
          var d = new Date();
          control.getRange(l + 2,9).setValue(d)
        }
      }
    }
  }
Cooper
  • 36,005
  • 6
  • 17
  • 42
  • I think your referring to for loop initialization. Here's my favorite [reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for) – Cooper Nov 24 '19 at 04:22
  • Also a couple of answers to this [question](https://stackoverflow.com/questions/2687392/is-it-possible-to-declare-two-variables-of-different-types-in-a-for-loop) might be helpful. – Cooper Nov 24 '19 at 04:25
  • Would this not work - `if(newPart[l][0] != 'kurt@metrolockdm.com' && newPart[l][0] != 'tim@wekeycars.com')`? – Sourabh Choraria Nov 24 '19 at 07:40

0 Answers0