I'm working with a variable called phone, which is a number type. My task is to verify that the first two digits of this phone number are not 33 or 32. In order to do this, I converted the number to a string and extracted the first and second digits for comparison.
let phoneText = this.phone.toString();
let digit1 = phoneText.charAt(0);
let digit2 = phoneText.charAt(1);
let twoDigits: string = digit1 + digit2;
if ((twoDigits != "33") || (twoDigits != "32")) {
alert("Invalid");
}
However, I encountered an issue with the if statement and received an error message that I'm having trouble understanding.
This condition will always return 'true' since the types "33" and "32" have no overlap.ts(2367)
let start: "33"