/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var x = "True"; var b = getBoolean(x); alert(b); function getBoolean(s) { return s.toLowerCase()=='true'?true:false; } // Another simple example var a = 11; a == 10 ? alert("true") : alert("false");
Comments
