js typeof

var show=function (x) {

            console.log(typeof x);    // undefined
            console.log(typeof 10);   // number
            console.log(typeof 'abc'); // string
            console.log(typeof true);  // boolean

            console.log(typeof function () {});  //function

            console.log(typeof [1, 'a', true]);  //object
            console.log(typeof { a: 10, b: 20 });  //object
            console.log(typeof null);  //object
            console.log(typeof new Number(10));  //object
			     
				  return 1;
        }

console.log( show instanceof Object)
		console.log( show())
		
		var fn=function(){}
				console.log( fn instanceof Object)

  

 

var dd="就ask打开";
	console.log(isNaN( parseInt(dd)));

  

posted @ 2018-07-25 13:57  山顶洞外人  阅读(108)  评论(0编辑  收藏  举报