程晓晖

博客园 首页 新随笔 联系 订阅 管理
运算数为数字 typeof(x) = "number" 字符串 typeof(x) = "string" 布尔值 typeof(x) = "boolean" 对象,数组和null typeof(x) = "object" 函数 typeof(x) = "function" typeof 运算符返回一个用来表示表达式的数据类型的字符串。 可能的字符串有:"number"、"string"、"boolean"、"object"、"function" 和 "undefined"。 如: alert(typeof (123));//typeof(123)返回"number" alert(typeof ("123"));//typeof("123")返回"string" var temp; alert(temp); //提示undefined alert(document.abc); //提示undefined alert(typeof(document.abc)) //提示undefined
posted on 2011-01-28 19:07  fumen  阅读(207)  评论(0编辑  收藏  举报