Hi,

I was trying something today when this occurred to me :

var a = {};


> function mutate(obj){

    obj = function(){

        alert('hey');

    };

}


> mutate(a);

a();


Firebug throws the following error:

> TypeError: a is not a function.



I want to understand why we can change the passed object inside mutate by
lets say adding more properties to it but not this way where I am redefining
it as a function object.

I hope my question is clear.

Thanks,

Rajat Mittal
http://www.lifeinafolder.com

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to