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

Another (even smaller) alternative is `.join`

`const classes = [some, classNames, here, foo ? 'foo' : ''].join(' ');`



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

Search: