Possible Duplicate:
How to convert an "object" into a function in JavaScript?
I have a theoretical question. As far as I know, {} objects come from Object, and functions inherit from that as well. Is there something user-accessible that can make {} objects callable, like functions, or is it interpreter magic?
I'm thinking of something like:
var myobj = {}
myobj["__call"] = function() {do_things();}
myobj();
and have it work. Is it possible? If not, why not?
Thanks!