title: Codewars Challenge - Count of positives / sum of negatives
body: <p>My code works but it's not being accepted in order to pass the challenge. Any help on what I'm doing wrong would be appreciated.</p>
  
  <p><strong>Challenge Description:</strong></p>
  
  <p>Given an array of integers.
  Return an array, where the first element is the count of positives numbers and the second element is sum of negative numbers.
  If the input array is empty or null, return an empty array:</p>
  
  <pre><code>C#/Java: new int[] {} / new int[0];
  C++: std::vector&lt;int&gt;();
  JavaScript/CoffeeScript/PHP/Haskell: [];
  Rust: Vec::&lt;i32&gt;::new();
  </code></pre>
  
  <p>ATTENTION!
  The passed array should NOT be changed. Read more here.*</p>
  
  <p><strong>For example:</strong></p>
  
  <p><strong>input</strong> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15]</p>
  
  <p><strong>return</strong> [10, -65].   </p>
  
  <p><strong>My Code:</strong></p>
  
  <pre><code>function countPositivesSumNegatives(input) {
  
  if (input.length &lt; 1){
    return [];
  }
  
  var newArray = [0, 0];
  
  
  for (var i = 0; i &lt; input.length; i++){
  
    if (input[i] &gt; 0)
      {
      newArray[0] += 1;
      }
  
    else {
      newArray[1] += input[i];
    }
  
    }
  return newArray;
  }
  </code></pre>