2016-05-12 61 views

回答

1

试试这个。

if(el.constructor !== elementFinder){ 
    throw "The supplied parameter is not an elementFinder and needs to be."; 
} 
1

您可以尝试使用instanceof运算符。

if(! (el instanceof elementFinder)){ 
    throw "The supplied parameter is not an elementFinder and needs to be."; 
} 
相关问题