Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js parse bool

function parseBool(value) {
    if (typeof value === "string") {
        value = value.toLowerCase();
        if (value === "true" || value === "false") {
            return value === "true";
        }
    }
    return; // returns undefined
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #parse #bool
ADD COMMENT
Topic
Name
5+2 =