title: Find max for an array, 0 if array is empty
body: <p>I need a clean way of finding <code>max</code> for an array in JavaScript. Say it is <code>arrayMax</code>, then:</p>
  <pre><code>arrayMax([]) // =&gt; 0
  arrayMax([1], [2]) // =&gt; 2
  arrayMax([-1]) // =&gt; -1
  </code></pre>
  <p>What I've tried:</p>
  <pre><code>Math.max.apply(null, [1,2,3]) // =&gt; 3
  </code></pre>
  <p>But it doesn't work for:</p>
  <pre><code>Math.max.apply(null, []) // =&gt; -Infinity
  </code></pre>
  <p>Note that it's not an duplication with <a href="https://stackoverflow.com/questions/1669190/javascript-min-max-array-values">this question</a> since I want the empty array to return 0, instead of <code>-Infinity</code></p>