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://codercto.com/courses/l/35.html
树莓派学习指南
[英]Peter Membrey、[澳]David Hows / 张志博、孙峻文 / 人民邮电出版社 / 2014-4 / 49.00元
树莓派(Raspberry Pi)是一款基于Linux系统的、只有一张信用卡大小的卡片式计算机。由于功能强大、性能出色、价格便宜等特点,树莓派得到了计算机硬件爱好者以及教育界的欢迎,风靡一时。 《树莓派学习指南(基于Linux)》是学习在树莓派上基于Linux进行开发的一本实践指南。全书共3个部分11章,第一部分是前两章,讲述如何设置和运行图形用户界面(GUI)。第二部分是第3章到第7章,讲......一起来看看 《树莓派学习指南》 这本书的介绍吧!
JSON 在线解析
在线 JSON 格式化工具
RGB转16进制工具
RGB HEX 互转工具