includes란? 배열이 특정 요소를 포함하고 있는지 판별하는 메서드.
ex)
let numArray = [1, 2, 3, 4, 5];
console.log(numArray.includes(7)); // false
console.log(numArray.includes(2)); // ture
valueToFind
문자나 문자열을 비교할 때, includes()
는 대소문자를 구분합니다.
fromIndex
배열에서 searchElement 검색을 시작하는 위치.
(음의 값 arrat.length + fromIndex의 인덱스를 asc로 검색) + 기본 값 = 0
ex)
let numArray = [1, 2, 3, 4];
numArray.includes(4, 4); // false
numArray.includes(4, 1000); // false