TypeScript: recursive one-liner
Fun but probably not performant, since we with each call we create a new array via Array.slice().\n\ni think whether there\'s tail-call optimization depends on 
Fun but probably not performant, since we with each call we create a new array via `Array.slice()`.\n\ni think whether there\'s tail-call optimization depends on the JavaScript engine used.\n\n```typescript\ntype Fn = (accum: number, curr: number) => number\n\nfunction reduce(nums: number[], fn: Fn, init: number): number {\n    return nums.length === 0\n        ? init\n        : reduce(nums.slice(1), fn, fn(init, nums[0]));\n};\n```
['Recursion', 'TypeScript']