.map(), .filter() 및 .reduce()와 같은 메소드로 작업하는 것은 좋지만 새 배열을 만들고 다음 단계로 이동하기 전에 모든 것이 열심히 수행됩니다.
https://github.com/RobinMalfait/lazy-collections
const program = pipe( map(x => x * 2), filter(x => x % 4 === 0), filter(x => x % 100 === 0), filter(x => x % 400 === 0), toArray() ); program(range(0, 1000000));
등록된 댓글이 없습니다.