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

nested ternaries are the same as if-else-if continuations. You figure that out one time, and it's easy to parse forever after.

The ternary operator in general eases understanding because it extracts the common bit, i.e. "sides[i] =", meaning you don't have to carefully read the contents of each and every conditional block to verify nothing else is going on besides this one assignment.

Applications are open for YC Summer 2018

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