title: Javascript callback function as a optional parameter for a function
body: <p>I have a javascript function which takes two arguments. First one is necessary and the second one is optional. The second argument is a callback function. How do I provide callback function as a default argument. The code that I wrote had errors.
  The code that I tried:</p>
  <pre><code>function doSomething(count,() =&gt; {}) {
  //code
  }
  </code></pre>