docs: async function map(array, fn, self = undefined) {
    const v = await Promise.resolve(array);
    if (!Array.isArray(v)) {
      throw TypeError('not an array');
    }
  
    const arr = /** @type {!Array} */(v);
    const n = arr.length;
    const values = new Array(n);
  
    for (let i = 0; i < n; i++) {
      if (i in arr) {
        values[i] = await Promise.resolve(fn.call(self, arr[i], i, arr));
      }
    }
    return values;
  }