The logic is fine. If you rename the variable to
isAdmin, it makes perfect sense. Either they are an admin, or they are not an admin, or the state is unknown (here expressed asnull). If you want to throw another JS-ism at this,undefinedcould be assigned before the check has been made.I regularly use variables like this. If
usersisundefined, I haven’t fetched them yet. If they’re a list, then fetching is complete. If they’renull, then there was an error while fetching.Like any good Boolean:
True / False / File not found
How many “equal” symbols do we need to be absolutely sure?
the real crime in this photo is the ===
The === is the best! I want to know they’re really the same and not just evaluate the the same.
any sane language has == behave that way. Javascript == is just completely bonkers.





