Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

TypeError: More arguments needed

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

Message

TypeError: Object.create requires more than 0 arguments
TypeError: Object.setPrototypeOf requires more than 1 argument
TypeError: Object.defineProperties requires more than 0 arguments

Error type

TypeError.

What went wrong?

There is an error with how a function is called. More arguments need to be provided.

Examples

The Object.create() method requires at least one argument and the Object.setPrototypeOf() method requires at least two arguments:

var obj = Object.create();
// TypeError: Object.create requires more than 0 arguments

var obj = Object.setPrototypeOf({});
// TypeError: Object.setPrototypeOf requires more than 1 argument

You can fix this by setting null as the prototype, for example:

var obj = Object.create(null);

var obj = Object.setPrototypeOf({}, null);

See also

文档标签和贡献者

 此页面的贡献者: fscholz
 最后编辑者: fscholz,