Im not really getting into the details of WHY doing this as its needed.
Supose i have a simple object.
var obj = {};
Lets say i want to access a random property of that object
obj.randomProp
This is getting me undefined.
Now, would it be possible, for that obj.randomProp return me another empty object ( {}
) ?
Of course, with no property declaration as obj.randomProp=123
. I was thinking on this to be dynamic, somehow like a default property getter
as if everytime you try to get a property of this element, you will get a new empty object for it.
Is this possible in JS ?