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

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();


Let me tell you about if..else!




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

Search: