2

The double NOT operator (!!) It's simply a way to convert/type-cast a non-boolean value to a boolean value, and !! <expression> gives us the opposite of ! <expression>. let foo = 'bar'; // non-empty string console.log( ! foo, !! foo ); // false, true foo = ''; // now it's an empty string console.log( ! foo, !! foo ); // true, false Issues in ...


Only top voted, non community-wiki answers of a minimum length are eligible