ExtJs--14--Ext.typeOf() 與 javascript中的typeof很相似,只是在類型上進行了一點簡單的擴充,其實可以直接看原始碼就可以看得懂的,javascripttypeof
Ext.typeOf()//Ext.typeOf() 與 javascript中的typeof很相似,只是在類型上進行了一點簡單的擴充,其實可以直接看原始碼就可以看得懂的// typeOf: function(value) {// var type,// typeToString;// // if (value === null) {// return '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';// case '[object RegExp]':// return 'regexp';// }//// if (type === 'function') {// return 'function';// }//// if (type === 'object') {// if (value.nodeType !== undefined) {// if (value.nodeType === 3) {// return (/\S/).test(value.nodeValue) ? 'textnode' : 'whitespace';// }// else {// return 'element';// }// }//// return 'object';// }//// //<debug error>// Ext.Error.raise({// sourceClass: 'Ext',// sourceMethod: 'typeOf',// msg: 'Failed to determine the type of the specified value "' + value + '". This is most likely a bug.'// });// //</debug>// }//Ext.typeOf() 和 Ext.type()的異同//下面這是源碼//Ext.type = Ext.typeOf;