Answers for "parse string into boolean javascript"

6

convert string true to boolean true javascript

stringToBoolean: function(string){
    switch(string.toLowerCase().trim()){
        case "true": case "yes": case "1": return true;
        case "false": case "no": case "0": case null: return false;
        default: return Boolean(string);
    }
}
Posted by: Guest on May-05-2020
0

Convert string to boolean in javascript

var isTrueSet = (myValue === 'true');
Posted by: Guest on July-09-2021

Code answers related to "parse string into boolean javascript"

Browse Popular Code Answers by Language