aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/errors/unexpected_token/index.html
blob: 91704a600683ef7819fad1b92fb49b4d9cf33361 (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
46
47
48
49
---
title: 'SyntaxError: Unexpected token'
slug: Web/JavaScript/Reference/Errors/Unexpected_token
tags:
  - 에러
  - 자바스크립트
translation_of: Web/JavaScript/Reference/Errors/Unexpected_token
---
<div>{{jsSidebar("Errors")}}</div>

<h2 id="메시지">메시지</h2>

<pre class="syntaxbox">SyntaxError: expected expression, got "x"
SyntaxError: expected property name, got "x"
SyntaxError: expected target, got "x"
SyntaxError: expected rest argument name, got "x"
SyntaxError: expected closing parenthesis, got "x"
SyntaxError: expected '=&gt;' after argument list, got "x"
</pre>

<h2 id="에러_타입">에러 타입</h2>

<p>{{jsxref("SyntaxError")}}</p>

<h2 id="무엇이_잘못되었나요">무엇이 잘못되었나요?</h2>

<p>특정 언어 구조를 예상했지만 무언가 다른 것이 있었습니다. 아마도, 간단한 오타일 것입니다.</p>

<h2 id="예제">예제</h2>

<h3 id="예상하지_못한_표현식">예상하지 못한 표현식</h3>

<p>예를 들어, 함수를 호출할 때, 인수에서 마지막 부분에 콤마는 허용되지 않습니다. 자바스크립트는 계속해서 다른 인자가 있을 것이라고 기대하기 때문입니다.</p>

<pre class="brush: js example-bad">Math.max(2, 42,);
// SyntaxError: expected expression, got ')'
</pre>

<p>콤마를 생략하거나 다른 인수를 추가해 수정할 수 있습니다.</p>

<pre class="brush: js example-good">Math.max(2, 42);
Math.max(2, 42, 13+37);
</pre>

<h2 id="참조">참조</h2>

<ul>
 <li>{{jsxref("Math.max()")}}</li>
</ul>