Tag:extjs4 source ext.typeof
Ext.typeof ()//ext.typeof () is similar to typeOf in JavaScript, except that a simple extension of the type can be seen directly from the source code//Typeof:function (value) {// var type,//typetostring;////if (value = = = NULL) {//RET Urn ' null ';//}////type = typeof value;////if (type = = = ' undefined ' | | type = = = ' String ' || Type = = = ' Number ' | | Type = = = ' Boolean ') {//return type;//}////typetostring = Tostring.call (value);//// Switch (typetostring) {//Case ' [Object array] '://Return ' Array ';// Case ' [Object Date] '://return ' date ';//Case ' [Object Boolean] ':// Return ' Boolean ';//Case ' [Object number] '://return ' number ';//CA Se ' [Object REGEXP] '://Return ' REGEXP ';//}////if (type = = = ' function ') {// return ' function ';//}////if (type = = = ' object ') {//if (Value.nodetyp e!== undefined) {//if (Value.nodetype = = = 3) {//Return (/\s/). Test (Value.node Value)? ' Textnode ': ' whitespace ';//}//else {//return ' element ';// }//}////return ' object ';//}//////<debug Err or>//Ext.Error.raise ({//Sourceclass: ' Ext ',//Sourcemethod: ' typeOf ',// Msg: ' Failed to determine the type of the specified value "' + Value + '". This is the most likely a bug. ' })/////</debug>//}//ext.typeof () and Ext.type ()///The following is the source code//ext.type = ext.typeof;
Extjs--14--ext.typeof () is very similar to the typeOf in JavaScript, just a bit of a simple extension on the type, you can actually see the source code directly can understand