2016-05-12 93 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."; 
} 
相關問題