blob: 41137d2f63d4c7f26b98325bcbdbe1509b8f58b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
---
title: 'TypeError: More arguments needed'
slug: Web/JavaScript/Reference/Errors/More_arguments_needed
translation_of: Web/JavaScript/Reference/Errors/More_arguments_needed
---
<div>{{jsSidebar("Errors")}}</div>
<h2 id="메시지">메시지</h2>
<pre class="syntaxbox">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
</pre>
<h2 id="에러_타입">에러 타입</h2>
<p>{{jsxref("TypeError")}}.</p>
<h2 id="무엇이_잘_못_되었을까">무엇이 잘 못 되었을까?</h2>
<p>함수 호출 시 에러가 있습니다. 더 많은 인수가 주어져야 합니다.</p>
<h2 id="예제">예제</h2>
<p>{{jsxref("Object.create()")}} 메서드는 적어도 1개의 인자가 필요하며, {{jsxref("Object.setPrototypeOf()")}} 메서드는 적어도 2개의 인자가 필요합니다.:</p>
<pre class="brush: js example-bad">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
</pre>
<p>예를 들면, 이렇게 프로토 타입으로 {{jsxref("null")}}를 세팅해서 고칠 수 있습니다.:</p>
<pre class="brush: js example-good">var obj = Object.create(null);
var obj = Object.setPrototypeOf({}, null);</pre>
<h2 id="참조">참조</h2>
<ul>
<li><a href="/en-US/docs/Web/JavaScript/Guide/Functions">Functions</a></li>
</ul>
|