Object.assign
is full of surprises and side effects.As example, assigning to an object something like
{get next() {return ++this.i}, i:0}
instead of {i:0, get next() {return ++this.i}}
will result in different values copied over: next === 1
and i === 1
in the first case, next === 1
and i === 0
in the second one.
No comments:
Post a Comment