Object.assign()

Rick Waldron waldron.rick at gmail.com
Wed Oct 17 19:41:16 PDT 2012


On Wednesday, October 17, 2012 at 10:34 PM, Rick Waldron wrote:
> On Wednesday, October 17, 2012 at 10:27 PM, Axel Rauschmayer wrote:
> > I’m a bit skeptical about excluding non-enumerable properties for Object.assign(). I still find enumerability a hard concept to wrap my mind around, because it pops up in unexpected places. At the moment, it mostly matters for for...in and Object.keys()/Object.getOwnPropertyNames(). Does it really make sense to increase its role in JavaScript?
> >  
> >  
>  
>  
>  

Sorry about that, I accidentally hit send...

It's a matter of paving the cow path of least surprise. Imagine if you tried to copy the properties and values of a plain object to an object with a null prototype and all of those properties you explicitly didn't want were now present.

Rick  

  
> >  
> > Axel
> >  
> > --  
> > Dr. Axel Rauschmayer
> > axel at rauschma.de (mailto:axel at rauschma.de)
> >  
> > home: rauschma.de (http://rauschma.de)twitter: twitter.com/rauschma (http://twitter.com/rauschma)
> > blog: 2ality.com (http://2ality.com)
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> > _______________________________________________
> > es-discuss mailing list
> > es-discuss at mozilla.org
> > https://mail.mozilla.org/listinfo/es-discuss
> >  
> >  
> >  
>  
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121017/c6b814ab/attachment-0001.html>


More information about the es-discuss mailing list