how to create a boolean function in javascript code example
Example 1: javascript can a var be a boolean
var YES = new Boolean(true);
Example 2: javascript function return boolean
function func(){
return true;
}
isBool = func();
console.log(typeof (isBool)); // output - string
let isBool = func();
console.log(typeof (isBool)); // output - boolean