jQuery.type()方法
jQuery 教程
· 2019-03-29 11:38:50
实例
该参数是否一个正则表达式
这是一个正则表达式? <b></b>
<script>
$(function () {
$( "b" ).append( "" + jQuery.type( /test/ ) );
})
</script>
定义和用法
$.type() 函数用于确定JavaScript内置对象的类型,并返回小写形式的类型名称。
如果对象是undefined或null,则返回相应的"undefined"或"null"
$.type( undefined ) === "undefined" $.type() === "undefined" $.type( window.notDefined ) === "undefined" $.type( null ) === "null"
如果对象有一个内部属性[[Class]]和一个浏览器的内置对象的 [[Class]] 相同,我们返回相应的 [[Class]] 名字。
$.type( true ) === "boolean" $.type( 3 ) === "number" $.type( "test" ) === "string" $.type( function(){} ) === "function" $.type( [] ) === "array" $.type( new Date() ) === "date" $.type( new Error() ) === "error" // jQuery 1.9 新增支持 $.type( /test/ ) === "regexp"
语法
$.type( obj )
参数 | 描述 |
---|---|
obj | 任意类型 需要确定类型的任意对象。 |
点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html
文明之光(第二册)
吴军 / 人民邮电出版社 / 2014-6 / 59.00元
【《文明之光》系列荣获由中宣部、中国图书评论学会和中央电视台联合推选的2014“中国好书”奖】 吴军博士从对人类文明产生了重大影响却在过去被忽略的历史故事里,选择了有意思的几十个片段特写,以人文和科技、经济结合的视角,有机地展现了一幅人类文明发展的宏大画卷。 《文明之光 》系列大致按照从地球诞生到近现代的顺序讲述了人类文明进程的各个阶段,每个章节相对独立,全景式地展现了人类文明发展历程......一起来看看 《文明之光(第二册)》 这本书的介绍吧!