

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 지원되는 런타임 기능
<a name="supported-features"></a>

아래 섹션에서는 APPSYNC\$1JS 런타임의 지원되는 기능 세트를 설명합니다.

## 핵심 기능
<a name="core-features"></a>

다음 핵심 기능이 지원됩니다.

------
#### [ Types ]

지원되는 유형은 다음과 같습니다.
+ 번호
+ 문자열
+ 부울
+ 객체
+ 배열
+ 함수

------
#### [ Operators ]

다음을 포함한 연산자가 지원됩니다.
+ 표준 수학 연산자(`+`, `-`, `/`, `%`, `*` 등)
+ nullish 병합 연산자(`??`)
+ 선택적 체인(`?.`)
+ bitwise 연산자
+ `void` 및 `typeof` 연산자
+ 분산 연산자(`...`)

다음 연산자는 지원되지 않습니다.
+ 단항 연산자(`++`, `--` 및 `~`)
+ `in` 연산자
**참고**  
`Object.hasOwn` 연산자를 사용하여 지정된 속성이 지정된 객체에 있는지 확인합니다.

------
#### [ Statements ]

다음 명령문이 지원됩니다.
+ `const`
+ `let`
+ `var`
+ `break`
+ `else`
+ `for-in`
+ `for-of` 
+ `if`
+ `return`
+ `switch`
+ 스프레드 구문

다음은 지원하지 않습니다.
+ `catch`
+ `continue`
+ `do-while`
+ `finally`
+ `for(initialization; condition; afterthought)`
**참고**  
지원되는 예외는 `for-in` 및 `for-of` 표현식입니다.
+ `throw`
+ `try`
+ `while`
+ 레이블이 지정된 명령문

------
#### [ Literals ]

다음 ES 6 [템플릿 리터럴](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)이 지원됩니다.
+ 여러 줄 문자열
+ 표현식 보간
+ 매핑 템플릿

------
#### [ Functions ]

다음 함수 구문이 지원됩니다.
+ 함수 선언이 지원됩니다.
+ ES 6 화살표 함수가 지원됩니다.
+ ES 6 rest 파라미터 구문이 지원됩니다.

------
#### [ Strict mode ]

함수는 기본적으로 엄격 모드에서 작동하므로 함수 코드에 `use_strict` 명령문을 추가할 필요가 없습니다. 이것은 변경할 수 없습니다.

------

## 기본 객체
<a name="primitive-objects"></a>

다음의 ES 기본 객체와 해당 기능이 지원됩니다.

------
#### [ Object ]

다음 객체가 지원됩니다.
+ `Object.assign()`
+ `Object.entries()` 
+ `Object.hasOwn()`
+ `Object.keys()` 
+ `Object.values()`
+ `delete` 

------
#### [ String ]

다음 문자열이 지원됩니다.
+  `String.prototype.length()` 
+  `String.prototype.charAt()` 
+  `String.prototype.concat()` 
+  `String.prototype.endsWith()` 
+  `String.prototype.indexOf()` 
+  `String.prototype.lastIndexOf()` 
+  `String.raw()` 
+  `String.prototype.replace()`
**참고**  
정규 표현식은 지원되지 않습니다.  
그러나 Java 스타일 정규식 구문은 제공된 파라미터에서 지원됩니다. 자세한 내용은 [패턴](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html)을 참조하세요.
+ `String.prototype.replaceAll()`
**참고**  
정규 표현식은 지원되지 않습니다.  
그러나 Java 스타일 정규식 구문은 제공된 파라미터에서 지원됩니다. 자세한 내용은 [패턴](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html)을 참조하세요.
+  `String.prototype.slice()` 
+  `String.prototype.split()` 
+  `String.prototype.startsWith()` 
+  `String.prototype.toLowerCase()` 
+  `String.prototype.toUpperCase()` 
+  `String.prototype.trim()` 
+  `String.prototype.trimEnd()` 
+  `String.prototype.trimStart()` 

------
#### [ Number ]

다음 번호가 지원됩니다.
+  `Number.isFinite` 
+  `Number.isNaN` 

------

## 기본 제공 객체 및 함수
<a name="built-in-objects-functions"></a>

다음 객체 및 함수가 지원됩니다.

------
#### [ Math ]

다음 수학 연산 함수가 지원됩니다.
+  `Math.random()` 
+  `Math.min()` 
+  `Math.max()` 
+  `Math.round()` 
+  `Math.floor()` 
+  `Math.ceil()` 

------
#### [ Array ]

다음 배열 메서드가 지원됩니다.
+ `Array.prototype.length` 
+ `Array.prototype.concat()` 
+ `Array.prototype.fill()` 
+ `Array.prototype.flat()` 
+ `Array.prototype.indexOf()` 
+ `Array.prototype.join()` 
+ `Array.prototype.lastIndexOf()` 
+ `Array.prototype.pop()` 
+ `Array.prototype.push()` 
+ `Array.prototype.reverse()` 
+ `Array.prototype.shift()` 
+ `Array.prototype.slice()` 
+ `Array.prototype.sort()`
**참고**  
`Array.prototype.sort()`는 인수를 지원하지 않습니다.
+ `Array.prototype.splice()` 
+ `Array.prototype.unshift()`
+ `Array.prototype.forEach()`
+ `Array.prototype.map()`
+ `Array.prototype.flatMap()`
+ `Array.prototype.filter()`
+ `Array.prototype.reduce()`
+ `Array.prototype.reduceRight()`
+ `Array.prototype.find()`
+ `Array.prototype.some()`
+ `Array.prototype.every()`
+ `Array.prototype.findIndex()`
+ `Array.prototype.findLast()`
+ `Array.prototype.findLastIndex()`
+ `delete` 

------
#### [ Console ]

콘솔 객체를 디버깅에 사용할 수 있습니다. 라이브 쿼리 실행 중에 콘솔 로그/오류 명령문이 Amazon CloudWatch Logs로 전송됩니다(로깅이 활성화된 경우). `evaluateCode`를 사용하여 코드를 평가하는 동안 명령 응답으로 로그 명령문이 반환됩니다.
+ `console.error()`
+ `console.log()`

------
#### [ Function ]
+ `apply`, `bind` 및 `call` 메서드는 지원되지 않습니다.
+ 함수 생성자는 지원되지 않습니다.
+ 함수를 인수로 전달하는 것은 지원되지 않습니다.
+ 재귀 함수 호출은 지원되지 않습니다.

------
#### [ JSON ]

다음 JSON 메서드가 지원됩니다.
+ `JSON.parse()`
**참고**  
구문 분석된 문자열이 유효한 JSON이 아닌 경우 빈 문자열을 반환합니다.
+ `JSON.stringify()`

------
#### [ Promises ]

비동기식 프로세스 및 약속은 지원되지 않습니다.

**참고**  
네트워크 및 파일 시스템 액세스는 `APPSYNC_JS` in AWS AppSync.의 런타임 내에서 지원되지 않습니다.는 AWS AppSync 해석기 또는 AWS AppSync 함수의 요청에 따라 모든 I/O 작업을 AWS AppSync 처리합니다.

------

## Globals
<a name="globals"></a>

다음과 같은 글로벌 제약이 지원됩니다.
+  `NaN` 
+  `Infinity` 
+  `undefined`
+ [https://docs.aws.amazon.com/appsync/latest/devguide/built-in-util-js.html](https://docs.aws.amazon.com/appsync/latest/devguide/built-in-util-js.html)
+ [https://docs.aws.amazon.com/appsync/latest/devguide/extensions-js.html](https://docs.aws.amazon.com/appsync/latest/devguide/extensions-js.html)
+ `runtime`

## 오류 유형
<a name="error-types"></a>

`throw`를 사용한 오류 발생은 지원되지 않습니다. `util.error()` 함수를 사용하여 오류를 반환할 수 있습니다. `util.appendError` 함수를 사용하여 GraphQL 응답에 오류를 포함할 수 있습니다.

자세한 내용은 [오류 유틸리티](https://docs.aws.amazon.com/appsync/latest/devguide/built-in-util-js.html#utility-helpers-in-error-js)를 참조하세요.