js判空

时间:2014-09-03 12:53:46   收藏:0   阅读:226

2014年9月3日 11:36:10

转载的: http://blog.sina.com.cn/s/blog_755168af0100vsik.html

typeof用法

typeof的运算数未定义,返回的就是 "undefined".

运算数为数字 typeof(x) = "number"

字符串 typeof(x) = "string"

布尔值 typeof(x) = "boolean"

函数 typeof(x) = "function"

对象,数组 和null typeof(x) = "object" //重要

 

原文:http://www.cnblogs.com/iLoveMyD/p/3953309.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!