Hacker News new | ask | show | jobs
by jannes 2264 days ago
With if you can also indicate "it's one of these things" by throwing an error at the end:

    if (cellA > cellB) return 1;
    if (cellA < cellB) return -1;
    if (cellA === cellB) return 0;
    throw new Error();
1 comments

Let me tell you about if..else!