Skip to content

Instantly share code, notes, and snippets.

View codehag's full-sized avatar
🍁
unresponsive until Nov. 2023

yulia codehag

🍁
unresponsive until Nov. 2023
View GitHub Profile
@codehag
codehag / option_1.js
Last active September 30, 2023 03:35 — forked from jorendorff/option_1.js
"use strict";
Iterator.prototype = {
*map(mapper) {
for (let value of this) {
yield mapper(value);
}
},
};

Core Proposal real-world examples

Living Document. J. S. Choi, 2018-12.

WHATWG Fetch Standard

The [WHATWG Fetch Standard][] contains several examples of using the DOM fetch function, resolving its promises into values, then processing the values in various ways. These examples may become more easily readable with smart pipelines.

var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Components.utils.import("resource://gre/modules/osfile.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
var done = false;
let gPaths = arguments.filter(a => !a.startsWith("-"));
if (!gPaths.length) {