How can I inherit the properties and all methods from window to an object created by me?
Since for example for this:
window.addEventListener();
I would like to make it small to use it habitually to:
var myObject = Object.create(window.prototype);
myObject.v = myObject.addEventListener;
Then then perform:
myObject.v("click",function(){});
That would be equivalent to doing:
window.addEventListener("click",function(){});
Only one syntax, shorter.
Is this possible? and how?
PS: I do not want to do one by one, this is what I mean:
function s(e,func,i = false) {
window.addEventListener(e.toString(),func, i);
}
But, completely inherit all your methods.