4 ms·
This looks a bit overdone. For the first example I'd just do it like this: const numbers = [,'one','two','three'] function matchNumber(n: number) { ret
by twfarland 9y ago
This looks a bit overdone. For the first example I'd just do it like this:
const numbers = [,'one','two','three']
function matchNumber(n: number) { return numbers[n] || n }