I have used an object in the past as a function argument, but this was
for a plugin that I wrote.  Using it in the architecture of a plugin
it worked.

BUT, this time, I just want to write a normal function, but still use
an object to set defaults and pass in changes to those defaults
through as a param.  Is this possible, or do I have to make this a
jQuery function like $.myfunction() ?

I am trying:

function test(defaults)
{
        var defaults = {
                test: ''
        };

alert(defaults.test);
}

test({test: 'It works!'});

The above does not seem to work, and replace the default with that was
passed in the function.  What am I doing wrong here?

Reply via email to