title: Set a default parameter value for a JavaScript function
body: <p>I would like a JavaScript function to have optional arguments which I set a default on, which get used if the value isn't defined (and ignored if the value is passed). In Ruby you can do it like this:</p>
  
  <pre><code>def read_file(file, delete_after = false)
    # code
  end
  </code></pre>
  
  <p>Does this work in JavaScript?</p>
  
  <pre><code>function read_file(file, delete_after = false) {
    // Code
  }
  </code></pre>