No built in function. I use this. It takes into account variable
arguments and accessor methods.
http://github.com/polotek/evented-twitter/blob/master/lib/underscore.js#L443-461
On Jul 24, 2:06 am, Stephen Belanger <
cyruzdr...@gmail.com> wrote:
> I don't recall if there is anything built-in for it, as I've always just
> made my own. Usually the built-in stuff isn't quite as flexible as it *could
> * be, just to be as generic as possible. Thus, if you plan on doing anything
> particularly complex it's often best to just do it yourself. Then you know
> exactly how it's "supposed" to function, and won't encounter any unpleasant
> surprises later on.
>
>
>
> On Fri, Jul 23, 2010 at 11:01 PM, James Carr <
james.r.c...@gmail.com> wrote:
> > Yeah, I know of ways to do this by hand, I was just under the
> > impression that ES5 had a built-in function for it. Am I incorrect?
> > I'm looking at the spec now, but so far no sign.
>
> > Thanks,
> > James
>
> > On Sat, Jul 24, 2010 at 12:55 AM, Dean Landolt <
d...@deanlandolt.com>
> > wrote:
>
> > > On Sat, Jul 24, 2010 at 1:53 AM, Stephen Belanger <
cyruzdr...@gmail.com>
> > > wrote:
>
> > >> Not exactly node-related, but try this.
> > >> var merge = function(a, b) {
> > >> for (var i in b) {
> > >> a[i] = b[i];
> > >> }
> > >> return a;
> > >> }
>
> > > This mutates a -- you'd probably want to create a new object here and
> > loop
> > > through both a and b to avoid any surprises.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "nodejs" group.
> > > To post to this group, send email to
nod...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > >
nodejs+un...@googlegroups.com<
nodejs%2Bunsu...@googlegroups.com>
> > .
> >
nodejs+un...@googlegroups.com<
nodejs%2Bunsu...@googlegroups.com>
> > .