Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The JavaScript Comma Operator (javascriptweblog.wordpress.com)
1 point by schrozinger on Oct 4, 2014 | hide | past | favorite | 1 comment


> ...you should make it your friend No. You shouldn't. Javascript has enough problems and obscure parts without people making their code look arcane. You should write your code as straightforward as possible. Imagine that you are writing in Pascal for your school project or something. Your code should be obvious, dull, completely boring. I want to look at your code and see that "user gets a bonus every 10th click", not that you used some "hackerish" operator to swap values in two lines of code instead of three but now there is a doubt whether it will work for all corner cases.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: