Answers for "js boolean return string "on off""

0

javascript function return boolean

function  func(){
  return true;
}

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


let isBool = func();
console.log(typeof (isBool));   // output - boolean
Posted by: Guest on June-28-2020
0

js extract boolean from string

JSON.parse("false".toLowerCase());  //returns false
Posted by: Guest on July-25-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language