Bind's not a new thing anymore. I've been using the arrow function instead of some of its functions and I think it's pretty simple. Not doing too much research.
Recently found bind will help you do strange things not only bind the following
Const x = X=>{x};x.prop = ' x '; const x2 = X.bind ({});//undefinedconsole.log (X2.prop)
found that the static properties on the X function were removed this is not what I want! Sometimes we just want the static properties on the function to be inherited!
You can do this. Throw attributes into the upper prototype chain
Const X = x=>{x};x.__proto__ = {prop: ' x ', __proto__:function.prototype}const x2 = X.bind ({});//xconsole.log (X2.prop)
In an environment that does not support ES5, we can look back at the code as follows (from MDN) in Polyfill implementation.
There's a difference between this and the native bind.
And the above code doesn't satisfy you because you don't want static objects to be killed! You have to do something!
In fact, as long as the above on the basis of adding a sentence on the line as follows
fbound.__proto__ = {__proto__:this. __proto__};
That's it.
Bind-June can't kill a static object.