Callback as an option in node.js
<p>I am working with node.js and how can I set callback as an option of a specific function?</p>

<p>For example:</p>

<pre><code>    function sum(a, b, callback) {
      return callback(a+b)
    }

    var result = sum(a,b) // this seems to cause error: callback is not a function

    sum(a, b, function(sum) {
      // this works fine
    })
</code></pre>

<p>Is there any way to make both of the above (with and without callback) work?</p>

<p>Thanks!</p>