16 lines
348 B
JavaScript
16 lines
348 B
JavaScript
(function () {
|
|
"use strict";
|
|
|
|
var forEachAsync = require('../forEachAsync').forEachAsync
|
|
;
|
|
|
|
forEachAsync([0, 500, 70, 800], function (next, element, i, arr) {
|
|
console.log(element, 'is element', i, 'of', arr.length);
|
|
this[element] = i;
|
|
setTimeout(next, element);
|
|
}, {}).then(function () {
|
|
console.log(this);
|
|
});
|
|
|
|
}());
|