title: Default value for function parameter?
body: <p>So I've been doing this for as long as I can remember, but I'm curious if this is really what I should be doing.  You write a function that takes a parameter, so you anticipate it to have a value, but if it doesn't, you have a good reason to default it, to say zero.  What I currently do is write a helper function:</p>
  
  <pre><code>function foo() { return foo(0); };
  function foo(bar) { ... };
  </code></pre>
  
  <p>I just ran across an instance where I did this and I looked at it oddly for a few seconds before understanding my logic behind it.  I come from php where it's trivial:</p>
  
  <pre><code>function foo(bar=0) { ... }
  </code></pre>
  
  <p>Is there a javascript alternative that I'm not aware of?</p>