We would like to know how to get String constructor.
<!DOCTYPE html>
<html>
<body>
<script type='text/javascript'>
<!-- w ww .j ava2 s. c om-->
var str = "true";
if ((str.constructor == String) && (str.toLowerCase() == "true")) {
document.writeln("OK");
}
</script>
</body>
</html>
The code above is rendered as follows: