Is there any function in javascript to do the same as the php function __call
?
I wish I could do something like:
var obj = {
__call: function(prop){
console.log('Call obj.'+prop);
return "fakeValue";
}
}
obj.somePropertie // fakeValue
Obviously the goal is to not only log, but this is the idea