functions js how to return true or false code example
Example 1: javascript if return true false
return condition ? value : otherValue;
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