Node.js examples for Data Type:Boolean
Convert a string to a boolean
// Convert a string to a boolean // (case-insensitive equality test against the string "true") String.prototype.bool = function(defaultToTrue) { if (defaultToTrue && this == "") { return true; }/*from w ww .j av a 2s . c o m*/ return (/ rue$/i).test(this); };