我在 Chrome 控制台上尝试了以下命令。我可以使用 new(下面的第 2 行)创建对象,但使用 call 不起作用。谁能解释可能是什么原因?
function ObjConstructor(){ this.sample = 1};
let withNew = new ObjConstructor();
let usingCall = ObjConstructor.call({});
usingCall
undefined //output that came on console, this is not a command
withNew
ObjConstructor {sample: 1} //output that came on console