Skip to content

Instantly share code, notes, and snippets.

@RobertLucian
RobertLucian / test.js
Created August 15, 2018 19:40
Just an async mapping function in JS
const asyncMap = (array, fn, callback) => {
var output = []; output.length = array.length;
var counter = 0
array.forEach((element, index, array) => {
fn(element, (na, number) => {
output[index] = number
counter++
if (output.length == counter) {