Javascript dynamic objects
<p>I don't really know the correct words to describe what I am trying to do, but the functionality is very similar to overriding the __get() function of PHP classes. For example this is what I want to do.</p>

<pre><code>var obj = {
    param1:'a',

    func1:function(){ return '1';},

    catch_all:function(input){
        return input;
    }
}

//alerts 'a'
alert( obj.param1 );

//alerts '1'
alert( obj.func1() );

//alerts 'anything'
alert( obj.anything );
</code></pre>

<p>Basically I want a way to redirect any unused key to a predefined key. I have done some research on this and really didn't know what to search for. Any help is greatly appreciated. Thanks.</p>
