4 ms·
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;
by jannes 7y 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();
- bluedino 7y agoLet me tell you about if..else!