ExtJs -- 14 -- Ext. typeOf () is very similar to typeof in javascript, but it simply expands the type. In fact, you can understand the source code directly. javascripttypeof

Source: Internet
Author: User

ExtJs -- 14 -- Ext. typeOf () is very similar to typeof in javascript, but it simply expands the type. In fact, you can understand the source code directly. javascripttypeof

Ext. typeOf () // Ext. typeOf () is very similar to typeof in javascript, but it only performs a simple extension on the type. In fact, you can directly view the source code to understand it. // 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) {// c Ase '[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': 'whitspace'; //} // 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 () and Ext. similarities and Differences of type () // The following is the source code // Ext. type = Ext. typeOf;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.