Convert a empty string to Boolean type in JavaScript
Description
The following code shows how to convert a empty string to Boolean type.
Example
<!--from w w w. j av a 2 s . c o m-->
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var aString = "";
var aBoolean = Boolean(aString);
document.writeln(aBoolean);
</script>
</head>
<body>
</body>
</html>
The code above generates the following result.
Javascript Tutorial Boolean
Add function to buildin type in JavaScript
Check the difference between Boolean Object...
Convert Boolean to string in JavaScript
Convert boolean to string by calling its to...
Convert undefined to boolean value with Boo...
Converts a non-zero value to Boolean type i...
Converts a zero value to Boolean type in Ja...
Create Boolean Object from boolean literal ...
Create boolean from null in JavaScript
Create boolean from object in JavaScript
Create two boolean type variables in JavaSc...
Get the Boolean value contained in the Bool...
Use and operator to calculate boolean value...
Use boolean literal true and false to creat...
Use false to create boolean variable in Jav...
Use if statement and Boolean conversion at ...
Add function to buildin type in JavaScript
Check the difference between Boolean Object...
Convert Boolean to string in JavaScript
Convert a empty string to Boolean type in J...
Convert a nonempty string to Boolean type i...Convert boolean to string by calling its to...
Convert undefined to boolean value with Boo...
Converts a non-zero value to Boolean type i...
Converts a zero value to Boolean type in Ja...
Create Boolean Object from boolean literal ...
Create boolean from null in JavaScript
Create boolean from object in JavaScript
Create two boolean type variables in JavaSc...
Get the Boolean value contained in the Bool...
Use and operator to calculate boolean value...
Use boolean literal true and false to creat...
Use false to create boolean variable in Jav...
Use if statement and Boolean conversion at ...