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

There is optional args for JS.

And it's not hack since it's a partial form of pattern matching.

Although simple and consice is absolutely not JS is famous for, a lot of functional programming languages with consice design do the same thing.

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