If you are completely new to JavaScript or programming in general, follow these steps:
0. Use an evergreen browser (Mozilla Firefox or Google Chrome)
- Install DevDocs desktop.
In "Preferences", enable following documentation- CSS
- DOM
- DOM Events
- ESLint
| export default function *filterMap (predicate, mapFn, it) { | |
| let i = 0, | |
| j = 0; | |
| for (const x of it) { | |
| if (predicate(x, i++, it)) | |
| yield mapFn(x, j++, it); | |
| } | |
| }; |
| "use strict"; | |
| const fs = require("fs"), | |
| fsP = fs.promises; | |
| const path = require("path"); | |
| const { chdir, cwd } = process; | |
| async function removeEVERYTHING (targetDir) { | |
| const oldDir = cwd(); | |
| chdir(targetDir); |
| "use strict"; | |
| /** | |
| * @param {string} tagName . | |
| * @param {object} [options] . | |
| * @param {string} options.className - The CSS class(es) to give to the node. Takes precedence over classList | |
| * @param {string[]} options.classList - The CSS classes to give to the node | |
| * @param {object<string, (string|number)>} options.style - The CSS style(s) to additionally give to the node | |
| * @param {string} options.textContent - The content of the node | |
| * @param {...<string, (string|number)>} options.attributes - Any other attributes to give to the node |
| function shallowCompare (comparator, prop) { | |
| return ({ [prop]: a }, { [prop]: b }) => comparator(a, b); | |
| } | |
| function deepCompare (comparator, props) { | |
| return (aRoot, bRoot) => { | |
| let a = aRoot, | |
| b = bRoot; | |
| for (const prop of props) { |
| "use strict"; | |
| const fsP = require("fs").promises; | |
| const path = require("path"); | |
| const { cwd, chdir } = process; | |
| /* | |
| Breadth-first | |
| */ | |
| /** |
| /** | |
| * prepareAsync - Wraps an asynchronous function to be called several times with a delay between each call. | |
| * @param {AsyncFunction} cb - The callback to wait for | |
| * @param {number} delay - The delay (in milliseconds) between each call | |
| * @param {Function} onFulfill - Function called after each success | |
| * @param {Function} onError - Function to handle errors thrown during the resolutions of `cb` AND `onFulfill` | |
| * @return {AsyncIterable} | |
| */ | |
| export default function prepareAsync (cb, delay, onFulfill, onError) { | |
| const sleep = { then (resolve) { |
| "use strict"; | |
| /* | |
| User-defined settings | |
| */ | |
| const protocol = "https"; // Change to http for old-school | |
| /* | |
| Begin! | |
| */ |
If you are completely new to JavaScript or programming in general, follow these steps:
0. Use an evergreen browser (Mozilla Firefox or Google Chrome)
| // Some generator fun! | |
| // WORK IN PROGRESS | |
| // Only accepts two arguments in the `cb` call for the moment | |
| "use strict"; | |
| const cbOnPrev = ((reset) => Object.defineProperty( | |
| function* cbOnPrev (cb) { | |
| let a = yield; // Replace `yield` with `function.sent` once it's a thing | |
| let b = yield a; |
| // If the Partial Application Syntax is not available, use this | |
| // Code by Kusu | |
| const partialBinder = ((hole, rest) => { | |
| "use strict"; | |
| function partiallyBound(fn, args, ...missing) { | |
| const argsLen = args.length; | |
| const missingIter = missing[Symbol.iterator](); | |
| for (let i = 0; i < argsLen; ++i) { | |
| switch (args[i]) { |