Skip to content

Instantly share code, notes, and snippets.

View marlass's full-sized avatar
🎯
Focusing

Marcin Lasak marlass

🎯
Focusing
View GitHub Profile
@yangsu
yangsu / product.js
Last active January 9, 2018 15:26
Javascript Generator function (ES2015) for creating cartesian product of multiple lists
function *productHelper(lists, prefix = []) {
if (lists.length === 0) {
yield [];
} else {
const [head, ...rest] = lists;
for (let item of head) {
const newPrefix = prefix.concat(item);
if (rest.length) {
yield *productHelper(rest, newPrefix);
} else {
@xem
xem / codegolf.md
Last active January 2, 2025 16:05
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)