Skip to content

Instantly share code, notes, and snippets.

View enshahar's full-sized avatar

Frank Hyunsok Oh enshahar

View GitHub Profile
@indongyoo
indongyoo / solution.js
Last active May 28, 2020 09:46
김동현님 질문 코드
function* filter(f, iter) {
for (const a of iter) if (f(a)) yield a;
}
function* take(limit, iter) {
for (const a of iter) if (limit--) yield a;
}
const head = iter => take(1, iter).next().value;