Tutorial Default Arguments for Functions
// Combiner of passed arguments and defaults (usable with any function) Object.prototype.combine = function(_args){ for(var i in this) { ...
https://iskablogs.blogspot.com/2014/03/tutorial-default-arguments-for-functions.html
// Combiner of passed arguments and defaults (usable with any function)
Object.prototype.combine = function(_args){
for(var i in this) {
if(typeof _args[i] == "undefined") {
_args[i] = this[i];
}
}
};
// Specific example function with defaults
function feedTheCat(args){
var defaults = {
'morning' : "nothing",
'noon' : "pork",
'nite' : "
Object.prototype.combine = function(_args){
for(var i in this) {
if(typeof _args[i] == "undefined") {
_args[i] = this[i];
}
}
};
// Specific example function with defaults
function feedTheCat(args){
var defaults = {
'morning' : "nothing",
'noon' : "pork",
'nite' : "