读书人

typeof typeof 123 为什么返回的是str

发布时间: 2012-04-07 17:31:50 作者: rapoo

typeof typeof 123 为什么返回的是string类型???
如题....

[解决办法]
var temp=typeof 123;//==>temp='number'
typeof typeof 123;//==>typeof 'number'==>'string'
[解决办法]

探讨

var temp=typeof 123;//==>temp='number'
typeof typeof 123;//==>typeof 'number'==>'string'

[解决办法]
typeof 123 返回的是字符串number,typeof number ,当然是字符串了
[解决办法]
表示赞同
[解决办法]
typeof 123首先返回的是Number类型,typeof Number则是String类型了
[解决办法]
typeof 123 返回的应该是字符串 'number'
所以typeof typeof 123 ----typeof 'number'--String
[解决办法]
楼上们,全++

读书人网 >JavaScript

热点推荐