Q:

javascript boolean


var x = false;

var y = new Boolean(false);


 //
typeof x returns boolean

 //
typeof y returns object
 
4
function  func(){
  return true;
}

isBool = func();
console.log(typeof (isBool));   // output - string


let isBool = func();
console.log(typeof (isBool));   // output - boolean
0

New to Communities?

Join the community