TypeError: More arguments needed

λ©”μ‹œμ§€

TypeError: argument is not an Object and is not null (Edge)
TypeError: Object.create requires at least 1 argument, but only 0 were passed
TypeError: Object.setPrototypeOf requires at least 2 arguments, but only 0 were passed
TypeError: Object.defineProperties requires at least 1 argument, but only 0 were passed

μ—λŸ¬ νƒ€μž…

무엇이 잘 λͺ» λ˜μ—ˆμ„κΉŒ?

ν•¨μˆ˜ 호좜 μ‹œ μ—λŸ¬κ°€ μžˆμŠ΅λ‹ˆλ‹€. 더 λ§Žμ€ μΈμˆ˜κ°€ μ£Όμ–΄μ Έμ•Ό ν•©λ‹ˆλ‹€.

예제

Object.create() λ©”μ„œλ“œλŠ” 적어도 1개의 μΈμžκ°€ ν•„μš”ν•˜λ©°, Object.setPrototypeOf() λ©”μ„œλ“œλŠ” 적어도 2개의 μΈμžκ°€ ν•„μš”ν•©λ‹ˆλ‹€.:

var obj = Object.create();
// TypeError: Object.create requires at least 1 argument, but only 0 were passed

var obj = Object.setPrototypeOf({});
// TypeError: Object.setPrototypeOf requires at least 2 arguments, but only 1 were passed

예λ₯Ό λ“€λ©΄, μ΄λ ‡κ²Œ ν”„λ‘œν†  νƒ€μž…μœΌλ‘œ  nullλ₯Ό μ„ΈνŒ…ν•΄μ„œ κ³ μΉ  수 μžˆμŠ΅λ‹ˆλ‹€.:

var obj = Object.create(null);

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

μ°Έμ‘°