This site has been taken over by the staff of www.ASPDeveloper.Net

Please report errors to suggest@aspdeveloper.net

BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
JavaScript
JavaScript Assertiveness
JavaScript Array Object Functions
JavaScript Arrays
JavaScript Variables
How to use JavaScript?
JavaScript Guidelines
Stock sorter example for IE5
Confused about how to use a data island in IE5??
Software Release tracking application
Employee Phonebook dataisland
Multitab DHTML browser
Trim function in Javascript
Multiple Grid
Re: Trim Function in JavaScript
Re: Trim Function in JavaScript
Trim Function in JavaScript using Regular Expressions.
DHTML ScoreBoard Behavior
Re: JScript Super Class To Handle XML Transformations
Updated: Detect XML Parser version using Javascript
XML Cache using IE 5.0 Behaviour
 
LAMP >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :2714

 

JavaScript Boolean Object

Introduction

The Boolean object is a wrapper for the Boolean data type. If you pass no value, 0, "" false, undefined or NAN then it will evaluate to false. However if you pass this value to an if condition then it will return true. So don’t confound the Boolean object with the boolen data type. Everything else passed into the object of Boolean will return true.

Example

<html>

<head>

<script type="text/javascript">

            // Returns false

            document.write("Returns false:<br/>")

            document.write(b = new Boolean("") + "<br/>")

            document.write(b = new Boolean() + "<br/>")

            document.write(b = new Boolean(false) + "<br/>")

            document.write(b = new Boolean(NaN) + "<br/>")

            document.write(b = new Boolean(null) + "<br/>")

            document.write(b = new Boolean(undefined) + "<br/>")

            document.write(b = new Boolean(0) + "<br/>")

            // Returns true

            document.write("<br/>Returns true:<br/>")

            document.write(b = new Boolean("true") + "<br/>")

            document.write(b = new Boolean(true) + "<br/>")

            document.write(b = new Boolean(1) + "<br/>")

</script>

</head>

<body></body>

</html>

Output


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Software Specialist, Linux - Finlan
Linux Core Technical Project Manage
Graphics designer at Tanzania. Expe
Integration Specialist Needed - Wor
Virtualization Server Infrastructur

View all Jobs (Add yours)
View all CV (Add yours)






    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP