title: Insert dashes into a number
body: <p>Any ideas on the following? I want to input a number into a function and insert dashes "-" between the odd digits. So 4567897 would become "456789-7". What I have so far is to convert the number into a string and then an array, then look for two odd numbers in a row and use the <code>.splice()</code> method to add the dashes where appropriate. It does not work and I figure I may not be on the right track anyway, and that there has to be a simpler solution.</p>
  
  <pre><code>function DashInsert(num) { 
    var numArr = num.toString().split('');
  
      for (var i = 0; i &lt; numArr.length; i++){
      if (numArr[i]%2 != 0){
        if (numArr[i+1]%2 != 0) {
            numArr.splice(i, 0, "-");
            }
          }
    }  
    return numArr;      
  }
  </code></pre>