This is referred to as an identity comparison, as in are these two operands exactly alike?
Comparisons are assertions that yield a true or false response.
The above comparison has no shortcut but to face-off each operand with the identity operator. There can be only one result.
Value resolution is how expressions work.
isLocked ? ... : ...; contains an expression in the condition of the ternary that resolves to an either/or state, and is easily coerced to a boolean.
The expression could naively be written as a comparison, but given the above rather moot.
isLocked === true ? ... : ...;
It’s not a comparison we need to make given value resolution which does this for us.
When calling the same function from either branch of a ternary, it is simpler to call the function on the ternary.
console.log(favoritePhrase === ‘Love That!’ ? ‘I love that!’ : 'I don’t love that!');