반응형 Every1 arr.every() (부분집합 구하기) const isBelowThreshold = (currentValue) => currentValue < 40; const array1 = [1, 30, 39, 29, 10, 13]; console.log(array1.every(isBelowThreshold)); // expected output: true 배열의 모든 요소가 콜백함수에서 true를 리턴하는지 여부를 리턴한다. 요소 하나라도 콜백함수에서 false를 리턴한다면 false 를 리턴. * .includes()메서드와 함께 사용하면 배열의 부분 집합인지 여부를 구할 수 있다. 2020. 11. 14. 이전 1 다음 반응형