title: Normalize numbers in array by custom number
body: <p>I have some dataset:</p>
  
  <pre><code>const dataset = [14, 50, 202, 208, 55];
  </code></pre>
  
  <p>And I have to create a new array using <code>dataset</code> like this:</p>
  
  <pre><code>const normalizedDataset = normalize(dataset, 5); // [15, 50, 200, 210, 55]
  </code></pre>
  
  <p>Had tried to write some function to do it, but unfortunately I have no brain to solve this problem. Tried like this:</p>
  
  <pre><code>const normalize = (arr, n) =&gt; {  
    return arr.map(x =&gt; {
      const y = (x % n) &gt; n / 2 ? x + (n - (x % n)) : (x % n);
      return y ? y : x;
    });
  }
  normalize(dataset, 5);
  </code></pre>
  
  <p>Maybe someone know some libs to do it or how to update my own function?</p>