JavaScript data types? code example
Example 1: javascript data types
var string = 'ASCII text';
var integer = 123456789;
var float = 123.456;
var t = true;
var f = false;
var undef;
var undef = undefined;
var nul = null;
var arr = ['Hello','my','name','is','Dr.Hippo',123,null];
var person = {'name':'John Smith','age':27};
var fun = function(){
return 42;
}
Example 2: js data types
string, number, boolean, null, undefined
Object, Function
Example 3: data types in javascript
1, 1.0
'String', "String"
true, false
{id: 1;}
[1, 2, 3]