If logical not !
will switch a boolean value from false to true or true to false and a double not !!
will cast a value from one primitive type to boolean is there any reason one can not use a logical not with a double not to create a triple not !!!
to cast a value to a boolean and then switch it!?! Is this what creates dark matter?
var test = !!"1"; // cast to boolean
var test2 = !!""; // cast to boolean
var test3 = !true; // switch true to false
var test4 = !false; // switch to true
var test5 = !!!"1"; // cast to boolean and switch to false
var test6 = !!!""; // cast to boolean and switch to true
console.log("values");
console.log("test:", test); // true
console.log("test2:", test2); // false
console.log("test3:", test3); // false
console.log("test4:", test4); // true
console.log("test5:", test5); // false
console.log("test6:", test6); // true
console.log("types");
console.log("test:", typeof test); // boolean
console.log("test2:", typeof test2); // boolean
console.log("test3:", typeof test3); // boolean
console.log("test4:", typeof test4); // boolean
console.log("test5:", typeof test5); // boolean
console.log("test6:", typeof test6); // boolean