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년 8월.
Array 인스턴스의 includes() 메서드는 배열의 항목에 특정 값이 포함되어 있는지를 판단하여 적절히 true 또는 false를 반환합니다.
찾을 값입니다.
fromIndex Optional검색을 시작할 0 기반 인덱스로, 정수로 변환됩니다.
배열(또는 fromIndex를 지정했다면, fromIndex 인덱스로 표시된 배열의 일부) 내에서 searchElement 값이 발견되면 true 불리언 값이 반환됩니다.
includes() 메서드는 SameValueZero 알고리즘을 사용하여 searchElement를 배열의 요소와 비교합니다. 0 값은 부호에 관계없이 모두 동일한 것으로 간주됩니다. (즉, -0은 0과 같지만), false는 0과 같은 것으로 간주되지 않습니다. NaN은 올바르게 검색될 수 있습니다.
희소 배열에 사용할 경우, include() 메서드는 빈 슬롯을 undefined로 간주하고 순회합니다.
includes() 메서드는 범용입니다. this 값에는 length 속성과 정수 키 속성만 있을 것으로 예상합니다.
fromIndex가 배열의 길이보다 크거나 같으면 false가 반환됩니다. 배열은 검색되지 않습니다.
fromIndex가 음수라면, 계산된 인덱스가 searchElement 검색을 시작할 배열의 위치로 사용되도록 계산됩니다. 계산된 인덱스가 0보다 작거나 같으면 전체 배열에서 검색됩니다.
희소 배열에서 undefined를 검색하면 true를 얻을 수 있습니다.
includes() 메서드는 this의 length 속성을 읽은 다음 키가 length보다 작은 음수가 아닌 정수인 각 속성에 접근합니다.
| ECMAScript® 2027 Language Specification # sec-array.prototype.includes |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 10월 10일 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.