- 4 Posts
- 3 Comments
Joined 10 months ago
Cake day: July 2nd, 2025
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
a === breturns true ifaandbhave the same type and are considered equal, and false otherwise. Ifaisnullandbis a boolean, it will simply return false.
I would certainly rather see this than
{isAdmin: bool; isLoggedIn: bool}. Withboolean | null, at least illegal states are unrepresentable… even if the legal states are represented in an… interesting way.





I was thinking of the three legal states as:
nullor{isAdmin: false, isLoggedIn: false})falseor{isAdmin: false, isLoggedIn: true})trueor{isAdmin: true, isLoggedIn: true})which leaves
{isAdmin: true, isLoggedIn: false}as an invalid, nonsensical state. (How would you know the user’s an admin if they’re not logged in?) Of course, in a different context, all four states could potentially be distinctly meaningful.