data type 1 javascript 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: javascript all type of data
let a = ["A", 1, true, [], [2, 'x'],{},{a:'B'}, NaN, undefined, null];
let s = a.toString();
console.log(s);