code: function regularizeL1(weights, gradientCount, stepSize) {
    const [gradient, count] = gradientCount;
  
    for (let i = 0; i < gradient.length; i++) {
      let grad = (gradient[i] || 0) / count;
      weights[i] = weights[i] || 0;
      weights[i] -= stepSize * grad + (weights[i] > 0 ? 1 : -1);
    }
  }
docs: L1, a.k.a Lasso