javascript:
const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
ie.
const firstTwoMax = ary(Math.max, 2); [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
등록된 댓글이 없습니다.
코리아뉴스 2001 - , All right reserved. 더보기