3 ms·
Why `Array.prototype.slice.call(xs, 1)` for tail operation?
by nvartolomei 11y ago
Why `Array.prototype.slice.call(xs, 1)` for tail operation?
- deleted 11y ago[deleted]
- exogen 11y agoThe code was probably converted from using `arguments` (which needs `Array.prototype.slice`) to using `...rest` params, and they just overlooked updating this line. The line above it also has a bug: it should be `xs.slice(-1)[0]`.