javascript的typeof返回哪些数据类型

    alert(typeof [1, 2]); //object
    alert(typeof 'leipeng'); //string
    var i = true; 
    alert(typeof i); //boolean
    alert(typeof 1); //number
    var a; 
    alert(typeof a); //undefined
    function a(){;};
    alert(typeof a) //function

 

posted @ 2017-07-15 13:08  无为-前端开发  阅读(1200)  评论(0编辑  收藏  举报