DEV Community

loading...

Discussion on: Bang bang, you're boolean!

Collapse
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;
}
Collapse
codingunicorn profile image
Coding Unicorn 🦄 Author • Edited

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