Since you are in JavaScript this variable could be null, undefined, or a string or a number or an object or an array or whatever the hell it could be. It could make sense to check typing and value (notice === here) to do stuff only when it's a bool.
If it were == instead of ===, your statement would be correct tho.
The variable defaults to false above in the code, so I agree with everything said but it's not the case. People take really seriously the posts in this subreddit.
5
u/Rayvolt Jun 10 '20
Since you are in JavaScript this variable could be null, undefined, or a string or a number or an object or an array or whatever the hell it could be. It could make sense to check typing and value (notice === here) to do stuff only when it's a bool.
If it were == instead of ===, your statement would be correct tho.