Need help with if-statement to set button disabled

I have this if-statement:

checkFields() {
      this.customerId != null && 
      this.dealerName != null &&
      this.organizationNumber != null && 
      this.numberOfUsers != null 
    ) {
      this.buttonStatus = false; 
    } else {
      this.buttonStatus = true; 

To me this basically says:

If all fields are filled, then enable the button (disabled = false) 

But even if just one field is filled, the statement sets the buttonstatus to false.

Am I missing something?

All the best


Nothing wrong with the above code, I had a typo in another class (of course)

filled is not a term in javascript.
foo; // variable is undefined
foo = null; //variable is null
foo = ‘’; //foo contains an empty string.

null means the variable exist but has no type or value.
for debuging to see what your variables are you can check it with an if statement.

Best regards, anna-liebt

Solved it! :slight_smile: It was a typo in my html-class, code above worked just fine after that :smiley: