Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Yansky
· 15y ago · 0 comments
I don't understand the need for the first example: Array.prototype.push.apply(a, b);
Isn't that what the concat() method is for?
Comments
[–]
tomstuart
15y ago
Array.prototype.push.apply(a, b) modifies
a
in-place; a.concat(b) returns a copy of
a
with
b
appended to it.