TypeError: More arguments needed
Komunikat
TypeError: Object.create requires more than 0 arguments TypeError: Object.setPrototypeOf requires more than 1 argument TypeError: Object.defineProperties requires more than 0 arguments
Typ błędu
Co poszło nie tak?
Błąd zaistniał w sposobie wywołania funkcji. Należy podać więcej argumentów.
Przykłady
Metoda Object.create()
(en-US) wymaga przynajmniej jednego argumentu a metoda Object.setPrototypeOf()
(en-US) wymaga przynajmniej dwóch:
var obj = Object.create();
// TypeError: Object.create requires more than 0 arguments
var obj = Object.setPrototypeOf({});
// TypeError: Object.setPrototypeOf requires more than 1 argument
Możesz temu zaradzić ustawiając null
jako prototyp, na przykład:
var obj = Object.create(null);
var obj = Object.setPrototypeOf({}, null);