Object.create() VS functions

Michaël Rouges michael.rouges at gmail.com
Sat Oct 26 09:22:05 PDT 2013


Thank you for your answers.

Sorry for my misnomer, I meant "to copy a function", not "to clone a
function".

In fact, it's been a while I do the technical research around the JavaScript
, and this research has led me to realize that there is no feature to simply
copy a function (or class) , including the properties thereof.

Regarding your exremièrement, there is a major difference between fn.bind()
and new Proxy(fn), fn.bind() doesn't copy the properties of the initial
function.

Then, new Proxy(fn) doesn't allow to add properties to the returned function as
my Object.create().

@Nathan : Thanks, a little too excited in my mind, I have made ​​a mistake, I
will correct it. ;)


Michaël Rouges - https://github.com/Lcfvs - @Lcfvs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131026/906d63c2/attachment.html>


More information about the es-discuss mailing list