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 2016년 9월.
TypedArray 인스턴스의 map() 메서드는 호출하는 형식화 배열의 모든 요소에 제공된 함수의 호출 결과로 채워진 새로운 형식화 배열을 생성합니다. 이 메서드는 Array.prototype.map()와 동일한 알고리즘을 가집니다.
형식화 배열의 각 요소에 대해 실행할 함수입니다. 일치하는 요소를 찾았으면 참 같은 값을 반환하고, 그렇지 않으면 거짓 같은 값을 반환해야 합니다. 함수는 다음 인수를 사용하여 호출됩니다.
element형식화 배열에서 현재 처리되고 있는 요소.
index형식화 배열에서 현재 처리되고 있는 요소의 인덱스.
arraymap()이 호출된 형식화 배열.
thisArg OptionalcallbackFn을 실행할 때 this로 사용할 값입니다. 순회 메서드를 참고하시기 바랍니다.
각 요소가 콜백 함수의 결과인 새로운 형식화 배열입니다.
보다 자세한 내용은 Array.prototype.map()을 참고하시기 바랍니다. 이 메서드는 범용적이지 않으며 오직 형식화 배열 인스턴스에서만 호출할 수 있습니다.
다음 코드는 형식화 배열을 받아서 첫 번째 형식화 배열에 있는 숫자의 제곱근 값을 포함하는 새로운 형식화 배열을 생성합니다.
다음 코드는 map()이 하나의 인수를 필요로 하는 함수와 함께 사용될 때 어떻게 작동하는지 보여줍니다. 인수는 map()이 원래 입력된 배열을 반복할 때 입력된 배열의 각 요소에 자동으로 할당됩니다.
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.map |
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.