DEV Community


Discussion on: Bang bang, you're boolean!

4r7d3c0 profile image
4r7d3c0 • Edited

Ok thanks nice tip. But why not !==== already :P. And then if you really meant !== then your example is incorrect because if user is null your code would return false which is not the case with !!. Sorry just being pedantic.

(this was written when the post had the following example)

function isLoggedIn() {
  return user !=== undefined;
codingunicorn profile image
Coding Unicorn 🦄 Author • Edited

Ooops! I've put too many === indeed :-)