TechCognition

Microsoft Visual Studio 2017 Promo Code
Microsoft Office 2016 Promo Code

Data types in Javascript

There are five simple data types also called primitive data types in java script. Those are Undefined, Null, Boolean, Number, and String. There is also one complex data type called Object.

undefined  -  if the value is undefined
                   Eg: var msg;
                   alert(typeof msg);


boolean -    if the value is a Boolean
                  Eg: var bol = true
                  alert(typeof bol);


string -     if the value is a string
               Eg: var str = "some string";
                     alert(typeof str);


number -  if the value is a number
               Eg: var no = 123;
               alert(typeof no);


object - if the value is an object or null


function - if the value is a function

Comments are closed

© Copyright 2018 www.techcognition.com | Sitemap