Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

string to boolean javascript

let toBool = string => string === 'true' ? true : false;
// Not everyone gets ES6 so here for the beginners
function toBool(string){
	if(string === 'true'){
      return true;
    } else {
      return false;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #string #boolean #javascript
ADD COMMENT
Topic
Name
3+9 =