Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2022년 3월.
TypedArray 인스턴스의 at() 메서드는 정수 값을 받아 해당 인덱스에 있는 항목을 반환하며, 양의 정수와 음의 정수를 모두 허용합니다. 음의 정수는 배열의 마지막 항목에서부터 역순으로 셉니다. 이 메서드는 Array.prototype.at()와 동일한 알고리즘을 가집니다.
반환할 배열 요소의 0부터 시작하는 인덱스로, 정수로 변환됩니다. 음수 인덱스는 형식화 배열 끝부터 역순으로 셉니다. index < 0인 경우, index + array.length로 접근합니다.
주어진 인덱스와 일치하는 형식화 배열의 요소입니다. index < -array.length 또는 index >= array.length인 경우, 해당 속성에 접근하지 않고 항상 undefined를 반환합니다.
보다 자세한 정보는 Array.prototype.at()를 참고하시기 바랍니다. 이 메서드는 범용적이지 않으며, 형식화 배열 인스턴스에서만 호출할 수 있습니다.
아래 예제는 주어진 배열에서 맨 마지막에 위치한 값을 반환하는 함수입니다.
아래 예제에서는 TypedArray의 뒤에서 두 번째 요소를 선택하는 다양한 방법을 비교합니다. 아래의 모든 방법이 유효하지만, at() 메서드의 간결성과 가독성을 강조합니다.
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.at |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.