Skip to content

Instantly share code, notes, and snippets.

View lmoorejc's full-sized avatar

Logan Moore lmoorejc

View GitHub Profile
@ppg
ppg / explainPromises.js
Created March 14, 2017 23:48
Demonstrates how ES6 promises work with respect to traditional callback tasks.
'use strict';
const async = require('async');
// All fN functions should take n and m and return all permutations between the two;
// i.e. for 2, 3:
// ['0 - 0', '0 - 1', '0 - 2', '1 - 0', '1 - 1', '1 - 2']
function workerTraditional(i, j, callback) {
// Put in a sleep