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

Spreading an array requires looping over all the array elements which is O(n) compared to something like Array.push() which is just 0(1), although spreading has other benefits like copying rather than mutating


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: