Thursday, 21 January 2016

Javascript Data Types

}JavaScript has dynamic types. This means that the same variable can be used as different types:
var x;               // Now x is undefined
var x = 5;           // Now x is a Number
var x = "John";      // Now x is a String
var x1=34.00;      // Written with decimals
var x2=34;         // Written without decimals
var y=123e5;      // 12300000
var z=123e-5;     // 0.00123

var x=true;
var y=false;

0 comments:

Post a Comment