JSFiddle - React, Tailwind, and code Playground

by Andrew Gerst

JavaScript

// return false/true tests with && and ||

function test(){
return true && alert("hey");
}

function test2(){
return true || alert("hey");
}

function test3(){
return false && alert("hey");
}

function test4(){
return false || alert("hey");
}

function init(){
    return test();
}

if (init()) alert("good");
else alert("bad");