Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



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: