for (var vx of x) {
    var wx = fm(vx, ++i, x);
    if (!s.has(wx)) a.push(vx);
  }