Object.mixin( source, target ) | arguments changed

Tobias Buschor tobias.buschor at gmail.com
Thu Jun 13 08:38:36 PDT 2013


I propose to change the arguments.

The second argument "target" is optional and default to
"Object.create(null)"
The return-value is the modified target

Advantages:
 - Without the second argument, we can copy the source
 - It is more natural to say "mixin the source into the target" =>
misin.(source, target)

Disadvantages
 - Its not suitable to extend the function to accept multiple sources in
the future
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130613/05fb66f6/attachment-0001.html>


More information about the es-discuss mailing list