Define object defaults for JavaScript function parameters
<p>I have a little class that extends the Date object in JavaScript.   One method just returns the current Date in UTC.</p>

<pre><code>Date.prototype.nowUTC = function(options) {

    var now = new Date();

    return new Date(now.getUTCFullYear(), 
                    now.getUTCMonth(), 
                    now.getUTCDate(), 
                    now.getUTCHours(), 
                    now.getUTCMinutes(), 
                    now.getUTCSeconds());
}
</code></pre>

<p>What I'd like to do is define the options parameter as an object that will contain hours, minutes, and seconds, which will be added to the time.  For example, </p>

<pre><code>Date.prototype.nowUTC = function(options) {

    var now = new Date();

    return new Date(now.getUTCFullYear(), 
                    now.getUTCMonth(), 
                    now.getUTCDate(), 
                    now.getUTCHours() + options.hours, 
                    now.getUTCMinutes() + options.minutes, 
                    now.getUTCSeconds()) + options.seconds;
}
</code></pre>

<p>Is there a way to pre-define these values, so I don't have to check if it's defined before adding it or set a default? (such as <code>function(options = {'hours' : null, 'minutes' : null, 'seconds' : null) {}</code>) Id prefer to handle the parmeter like - as one object - instead of passing separate params for each value.</p>

<p>Thank you!</p>
