首页 > 其他 > 详细

typeof的返回值

时间:2017-09-05 16:26:35      阅读:307      评论:0      收藏:0      [点我收藏+]

typeof一共可以返回6种值,分别是number、boolean、string、function、object、undefined

typeof(1) typeof(NaN)    返回number

typeof(true) typeof(false)    返回boolean

typeof(‘ ‘)          返回string

typeof(function fun(){})    返回function

typeof(undefined)      返回undefined

typeof(null)和new出来的实例返回值都是 object

typeof的返回值

原文:http://www.cnblogs.com/jr-goon/p/7479072.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!