gpt4 book ai didi

javascript - javascript 中对象创建类型之间的差异

转载 作者:行者123 更新时间:2023-12-03 02:03:31 26 4
gpt4 key购买 nike

有什么区别

var obj = new factoryCreation;

var obj = new factoryCreation();

在 JavaScript 中。

这两个是一样的吗?假设factoryCreation是一个函数。

最佳答案

MDN Web Docs说:

new Foo is equivalent to new Foo(), i.e. if no argument list is specified, Foo is called without arguments.

关于javascript - javascript 中对象创建类型之间的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49914873/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com