unclechu / node-deep-extend

Recursive extend module
MIT License
202 stars 53 forks source link

Example from README: [] replaces a number #17

Closed inca closed 9 years ago

inca commented 9 years ago

I am pretty confused about the logic in README:

Now that's what I call a surprise! Please correct me if I'm wrong to expect f == [] in target.

TIA

unclechu commented 9 years ago

@inca sorry about that, it was documentation issue, f was duplicated:

var obj2 = {
    b: 3,
    c: 5,
    d: {
        b: { first: 'one', second: 'two' },
        c: { test2: 222 }
    },
    e: { one: 1, two: 2 },
    f: [], // <- here
    g: (void 0),
    h: /abc/g,
    f: null // <- and here
};

Actually f will be [].

inca commented 9 years ago

Got it, thanks!