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월.
some() 메서드는 형식화 배열 내 일부 요소가 제공되는 함수에 의해 구현되는 테스트를 통과하는지 여부를 테스트합니다. 이 메서드는 Array.prototype.some()과 같은 알고리즘입니다. TypedArray는 여기 TypedArray 객체 유형 중 하나입니다.
각 요소에 대해 테스트하는 함수, 다음 인수 셋을 취하는:_ currentValue _ : 형식화 배열에서 현재 처리 중인 요소.
index형식화 배열에서 현재 처리 중인 요소의 인덱스.
arraysome이 호출한 형식화 배열.
thisArg선택 사항. callback을 실행할 때 this로서 사용하는 값.
some 메서드는 callback이 true 값을 반환하는 요소를 찾을 때까지 형식화 배열에 있는 각 요소에 대해 한 번 callback 함수를 실행합니다. 그런 요소가 발견된 경우, some은 즉시 true를 반환합니다. 그렇지 않으면, some은 false를 반환합니다.
callback은 세 인수와 함께 호출됩니다: 요소값, 요소 인덱스 및 순회(traverse)되는 배열 객체.
thisArg 매개변수가 some에 제공되는 경우, 호출될 때 callback에 전달됩니다, 그 this 값으로 사용하기 위해. 그렇지 않으면, undefined 값이 그 this 값으로 사용하기 위해 전달됩니다. callback에 의해 결국 관찰할 수 있는 this 값은 함수에 의해 보이는 this를 결정하는 평소 규칙에 따라 결정됩니다.
some은 호출된 형식화 배열을 변화시키지(mutate) 않습니다.
다음 예는 형식화 배열의 모든 요소가 10보다 더 큰지 테스트합니다.
화살표 함수는 같은 테스트에 대해 더 짧은 구문을 제공합니다.
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.some |
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.