if is true javascript code example
Example 1: check if javascript function is true
function example(){
return true;
}
if(example()){
console.log('hello');
}else{
console.log('bye');
}
// result: 'hello'
Example 2: javascript if
if (32 == 32) {
console.log('32 is equil to 32!');
}