title: reduce() in CoffeeScript - how do I pass a default value?
body: <p>So I've been toying around with CoffeeScript a bit recently. So far the transition from JS has been rather smooth, but now I've finally run into a problem I really can't figure out.</p>
  
  <p>I've got this piece of ES6:</p>
  
  <pre><code>function upcaseOddIndexes (arr, cha, ind) {
    if (ind % 2 === 0) {
       arr.push(cha.toUpperCase());
    } else {
       arr.push(cha);
    }
    return arr;
  }
  
  var string = "stringthing";
  var upcasedString = string.split("")
                      .reduce((arr, cha, ind) =&gt; upcaseOddIndexes (arr, cha, ind), [])
                      .join("");
  
  console.log(upcasedArray);
  </code></pre>
  
  <p>which does its job (returning a new string with the letters at odd indexes uppercased) just fine. The <code>upcaseOddIndexes</code> function is no problem either. But  how do I pass the empty array as the <code>initialValue</code> to <code>reduce()</code>?   </p>
  
  <p>My best guess was</p>
  
  <pre><code>.reduce(arr, cha, ind -&gt; upcaseOddIndexes arr, cha, ind) []
  </code></pre>
  
  <p>which gives me</p>
  
  <pre><code>.reduce(arr, cha, ind(function() {
    return upcaseOddIndexes(arr, cha, ind);
   }))([])
  </code></pre>
  
  <p>and that's going nowhere, since <code>arr is not defined</code>.</p>
  
  <p>I've tried adding more parens, commas and whatnot, but I always meet with <code>unexpected ,</code> or something similar.</p>
  
  <p>I've already had a good rummage around Google, but haven't found an answer so far. There's <a href="https://stackoverflow.com/questions/22028924/coffeescript-idiom-for-array-reduce-with-default-value">this question</a> on the topic, but it didn't really help.</p>
  
  <p>Thanks a lot in advance =)</p>