title: How to generated N numbers in array that sum of these numbers is equal to 0
body: <p>I have a code like this:</p>
  
  <pre><code>function myArr(N){
  
      let arr = [];
  
      function randomNumber(min,max) {
          if (min &gt; max) {
              let vMin = min;
              min = parseInt(max,10);
              max = parseInt(vMin,10);
          }
          return Math.floor(Math.random()*(max-min+1)+min);
      }
  
      for(let i = 0; i &lt; N; i++) {
          arr.push(randomNumber(100,-100));
      }
      return arr;
  }
  </code></pre>
  
  <p>This function generates an array with N numbers. But I want that the sum of these generated numbers will be equal to 0. How to make it? I was thinking about conditional 'if' but I don't exactly know, how to use it in this case ... Maybe some of you know, how to do this? Thanks for any tips!</p>