Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Yansky
on July 5, 2011
|
parent
|
context
|
favorite
| on:
Advanced Javascript tips and tricks
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?
tomstuart
on July 5, 2011
[–]
Array.prototype.push.apply(a, b) modifies
a
in-place; a.concat(b) returns a copy of
a
with
b
appended to it.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Isn't that what the concat() method is for?