function take(num, list) { if (num <= 0 || !list || list === []) return []; var [head, ...tail] = list; return [head].concat(take(num - 1, tail)); }
Once we have support for tail call optimization, things will get really interesting.
Once we have support for tail call optimization, things will get really interesting.