javascript boolean

JavaScript
if (typeof variable === "boolean"){
  // variable is a boolean
}function  func(){
  return true;
}

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


let isBool = func();
console.log(typeof (isBool));   // output - booleanvar thing = true; //try changing this to false
thing = !thing; //the variable will go from true to false, or from false to true
Source

Also in JavaScript: