Skip to main content
Active reading [<https://en.wiktionary.org/wiki/Boolean#Noun>].
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

You don't need to use !! inside an if expression.
  It's being used the convert the value to a booleanBoolean, and the if does it by default.

var x = ""; // aA falsy value !x // true !!x // false if (x) === if (!!x) 

You don't need to use !! inside an if expression.
  It's being used the convert the value to a boolean, and the if does it by default.

var x = ""; // a falsy value !x // true !!x // false if (x) === if (!!x) 

You don't need to use !! inside an if expression. It's being used the convert the value to a Boolean, and the if does it by default.

var x = ""; // A falsy value !x // true !!x // false if (x) === if (!!x) 
Source Link
gdoron
  • 150.6k
  • 59
  • 302
  • 376

You don't need to use !! inside an if expression.
It's being used the convert the value to a boolean, and the if does it by default.

var x = ""; // a falsy value !x // true !!x // false if (x) === if (!!x)