typeof的用法

typeof可以返回变量的类型,返回值为字符串,其值有

"undefined"

"boolean"

"string"

"number"

"object"

"function"

而 typeof(null)会返回object

 

posted @ 2017-06-13 10:15  慵懒的小猪  阅读(337)  评论(0)    收藏  举报