Hacker News new | past | comments | ask | show | jobs | submit login

Maybe for Python a stringbuilder is faster, but for JavaScript, += is faster.

https://jsperf.com/javascript-concat-vs-join/2

Don't assume a certain way of coding is faster because you read it on the Internet, actually profile your code.




> Maybe for Python a stringbuilder is faster, but for JavaScript, += is faster.

I am amazed and saddened, that in 2020, concatenating strings, regardless of the form or language, is not blazing fast across all environments.




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

Search: