摘要:
1 '',null,undefined转换为bool类型时都为false//'handle '',undefined and null' 0也会转换为false,但一般不会输入0if (selector) { return;} 2 根据对象的属性判断是否为你所要的对象// 根据是否有nodeType属性判断为DOM对象if ( selector.nodeType ) { this[0] = selector; this.length = 1; this.context = selector; return this;} 3 阅读全文