To simplify the process, start by combining the two statements into one for easier understanding. If either the first statement or the last statement is true, then the overall result will be false.
public noArtistBeingEdited(): boolean {
if (this.isFirstNameBeingEdited() || this.isLastNameBeingEditable()) {
return false;
}
return true;
}
You can consolidate
this.isFirstNameBeingEdited() || this.isLastNameBeingEditable()
inside brackets to treat it as a single statement.
(this.isFirstNameBeingEdited() || this.isLastNameBeingEditable())
=== false
If you negate the entire statement, it will result in true:
!(this.isFirstNameBeingEdited() || this.isLastNameBeingEditable())
This indicates that both conditions need to be false for the function to return true:
let fn = (a, b) => {
if (a) {
return false;
}
if (b) {
return false;
}
return true;
};
console.log(fn(true, true)); // false
console.log(!(true || true)); // false
console.log(fn(false, false)); // true
console.log(!(false || false)); // true
console.log(fn(false, true)); // false
console.log(!(false || true)); // false
console.log(fn(true, false)); // false
console.log(!(true || false)); // false