이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 함께 해서 번역을 마치도록 도와 주세요!
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
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);