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

[] + [] === ""

Elegant... hmmmmm




[1,2,3].toString() === "1,2,3"

[].toString() === ""

It's only confusing to people who really don't know anything about the language.



Are you arguing that this is confusing to you and therefore not elegant, or are you arguing that this code compiles and that means it is not elegant?

Would you write that in production?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: