Lets say that error.message = 'user_not_found'
console.log(
error.message === 'user_not_found' || error.message === 'password_missing_onboarding_incomplete'
? false
: true
);
This returns false and is working good.
I tried shortening this to:
console.log(error.message !== 'user_not_found' || error.message !== 'password_missing_onboarding_incomplete');
Which I assumed would work the same, but instead it returned true. Am I missing something?
The negative of
error.message === 'user_not_found' || error.message === 'password_missing_onboarding_incomplete'
is
error.message !== 'user_not_found' && error.message !== 'password_missing_onboarding_incomplete'
just group the logic and then negate it
console.log(!(error.message === 'user_not_found' || error.message === 'password_missing_onboarding_incomplete'));
if it was full it would be
let result = !(
error.message === 'user_not_found' ||
error.message === 'password_missing_onboarding_incomplete'
);