BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
JavaScript
JavaScript String Object Functions
JavaScript String Object
JavaScript Object Orientation
JavaScript Objects
JavaScript Number <=> String Conversion
JavaScript Nothingness
JavaScript Math Object Functions
JavaScript Math Object
JavaScript Functions
JavaScript Form
JavaScript Error (try/catch/finally)
JavaScript Date Object Functions
JavaScript Date Object
JavaScript Loops
JavaScript Operators
JavaScript Conditional Statements
JavaScript Boolean Object
JavaScript Assertiveness
JavaScript Array Object Functions
JavaScript Arrays
 
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 :3965

 

JavaScript typeof

Introduction

The JavaScript typeof can be used to determine the type of the data type. Whether it’s an object, array, string or something else. This can be important because the data type you are working with will have certain functions and features, which aren’t available for each data type. The following example demonstrates it.

Example

<html>

<head>

<script type="text/javascript">

            function Motel()

            {

                        // do some stuff here

            }

            var objMotel = new Motel()

            var arMyArray = new Array(10)

            var stMyString = "Hello"

            var nInteger = 99

            var bBool = true          

            document.write(typeof(objMotel) + "<br/>")

            document.write(typeof(arMyArray) + "<br/>")

            document.write(typeof(stMyString) + "<br/>")

            document.write(typeof(nInteger) + "<br/>")

            document.write(typeof(bBool) + "<br/>")

            document.write(typeof(Motel) + "<br/>")

</script>

</head>

<body></body>

</html>

Output


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C
Immediate ASP.NET/C# Openings for C
Sr. Software Engineer

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



soccer drills
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses
conference call


    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