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월.
every() 메서드는 배열 안의 모든 요소가 주어진 판별 함수를 통과하는지 테스트합니다. 이 메서드는 Array.prototype.every()와 같은 알고리즘을 가지고 있습니다. TypedArray은 형식화 배열 타입 중 하나입니다.
각 요소를 시험할 함수.
다음 세 가지 인수를 받습니다.
element배열에서 처리되는 현재 요소.
index이 형식화 배열에서 처리할 현재 요소의 인덱스.
arrayevery를 호출한 형식화 배열.
thisArg OptionalcallbackFn을 실행할 때 this로 사용하는 값.
콜백 함수가 모든 배열 요소가 참 같은 값을 반환하면 true를 반환하며, 그렇지 않으면 false를 반환합니다.
every는 callbackFn이 falsy을 반환하는 요소를 찾을 때까지 형식화 배열에 있는 각 요소에 대해 한 번씩 callbackFn 함수를 실행합니다. 해당하는 요소를 발견한 경우 every는 즉시 false를 반환합니다. 그렇지 않으면, 즉 모든 값에서 truthy을 반환하면 true를 반환합니다.
callbackFn은 요소의 값, 해당 요소의 인덱스 및 순회하고 있는 형식화 배열 세 가지 인수와 함께 호출됩니다.
thisArg 매개변수를 every에 제공한 경우 callbackFn의 this로 사용됩니다. 그 외엔 undefined값을 사용합니다. 최종적으로 callbackFn이 볼 수 있는 this의 값은 함수의 this를 결정하는 일반적인 규칙을 따릅니다.
every는 호출한 배열을 변형하지 않습니다.
다음 예는 형식화 배열의 모든 요소가 9보다 더 큰지 테스트합니다.
화살표 함수는 테스트 함수를 위해 더 짧은 구문을 제공합니다.
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.every |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 6월 24일 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.