Re:Default Parameters in JavaScript
by STRML on Thursday March 21, 2013 @12:36PM
(#5416432)
This is a good point, and unfortunately it means that most of the advantage of using _.defaults() goes by the wayside. It just becomes a matter of personal preference. Thanks for the tip.
[ Parent
| on HN ]
> This is a good point, and unfortunately it means that most of the advantage of using _.defaults() goes by the wayside.
How and why? I don't consider mutating the original object to be an advantage of using _.defaults, unless the object is completely under your control and you're essentially calling `_.defaults(this, defaults)`.