Skip to content

Instantly share code, notes, and snippets.

View vyprichenko's full-sized avatar

vyprichenko

  • Odesa, Ukraine
  • 11:29 (UTC +02:00)
View GitHub Profile
@briancavalier
briancavalier / example.js
Last active November 24, 2021 20:10
Infinite "lists" in es6 using generators and yield
// Requires traceur
import { iterate, take, map, foldl } from './list-out-of-yield';
// Sum of squares of integers 1..100
var values = take(100, iterate(x => x + 1, 1));
var result = foldl((x, y) => x + y, 0, map(x => x * x, values));
console.log(result);