function func(){ return true; } isBool = func(); console.log(typeof (isBool)); // output - string let isBool = func(); console.log(typeof (isBool)); // output - boolean
>>> a = true; true >>> !a; false