[javascript] every

Jean Young Park·2023년 6월 25일
0

javascript

목록 보기
4/15

every() 메서드는 배열 안의 모든 요소가 주어진 판별 함수를 통과하는지 테스트한다. Boolean 값을 반환한다.

const isBelowThreshold = (currentValue) => currentValue < 40;

const array1 = [1, 30, 39, 29, 10, 13];

console.log(array1.every(isBelowThreshold)); //true

0개의 댓글