我有以下功能
function Client(url,name){
this.name = name;
this.url = url;
}
Client.prototype.check = () => (...some logic);
const client = new Client(url, name)
如何添加一个条件,即没有new
关键字就不会调用该函数
我有以下功能
function Client(url,name){
this.name = name;
this.url = url;
}
Client.prototype.check = () => (...some logic);
const client = new Client(url, name)
如何添加一个条件,即没有new
关键字就不会调用该函数