title: using shift with an empty input js
body: <p>I have a basic question about using the .shift method.  Below is my working code to convert a number to the sum of all digits.  After converting to string and splitting to array, if the first value is the '-' sign I use .shift to remove this element, then make the next value negative.  My question is, where does the '-' go?  What happens to this value that I have not assigned to any variable?</p>
  
  <p>Moving forward, should I be concerned about using this method if it will potentially leave values sort of 'floating' around in my code?</p>
  
  <pre><code>function sumDigits(num) {
  var numArr = num.toString().split('');
  if (numArr[0] === '-') {
      numArr.shift();
      numArr[0] *= -1;
  }
  var total = numArr.map(Number).reduce(function(a, b) {
      return a + b;
  });
  return total;}
  </code></pre>
  
  <p>Thanks!</p>