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

Case in point: the left-pad package has quadratic complexity.


Depends on the JS implementation in question. And I think node uses one that optimizes string concatenation, possibly making that the fastest way to do it.


Yeah, as far as I know in modern JS engines += is actually faster than using an array.


[citation needed]

It's really nice how we once again depend on "I think some guys do it like this" for performance. What happened to standards?

What's next? SEO for code?




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: