JS get type of variable javascript

var n = 0.87;
var sType = typeof n; //number
 
var str = "Hello Sapce!";
sType = typeof str; //string
 
typeof true === 'boolean';
typeof undefined === 'undefined';
 
typeof function() {} === 'function';
// etc.  ....... 
 
// try get type of null, Infinity, NaN .... 
var strTypeOfNull = typeof null;
alert(strTypeOfNull);
This entry was posted in Javascript css html and tagged . Bookmark the permalink.


Comments are closed.

627 views