$.type():
使用许多技术来确定对象的确切返回值。 [[Class]] 的确定如下:
- jQuery.type( undefined ) === "undefined"
- jQuery.type() === "undefined"
- jQuery.type( window.notDefined ) === "undefined"
- jQuery.type( null ) === "null"
- jQuery.type( true ) === "boolean"
- jQuery.type( new Boolean() ) === "boolean"
- jQuery.type( 3 ) === "number"
- jQuery.type( new Number(3) ) === "number"
- jQuery.type( "test" ) === "string"
- jQuery.type( new String("test") ) === "string"
- jQuery.type( function(){} ) === "function"
- jQuery.type( [] ) === "array"
- jQuery.type( new Array() ) === "array"
- jQuery.type( new Date() ) === "date"
- jQuery.type( new Error() ) === "error" // as of jQuery 1.9
- jQuery.type( Symbol() ) === "symbol" // as of jQuery 1.9
- jQuery.type( Object(Symbol()) ) === "symbol" // as of jQuery 1.12
- jQuery.type( /test/ ) === "regexp"