return true or false javascript 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
Example 3: javascript return false
<a href="#" onClick="function_name('parametres'); return false;">Link</a>