var x = false; var y = new Boolean(false); // typeof x returns boolean // typeof y returns object
function func(){ return true; } isBool = func(); console.log(typeof (isBool)); // output - string let isBool = func(); console.log(typeof (isBool)); // output - boolean