const fizzbuzz = (end = 100, i = 1, result = ) => i <= end ? fizzbuzz(end, i + 1, [ ...result, ((i % 3 === 0 ? 'Fizz' : '') + (i % 5 === 0 ? 'Buzz' : '')) || i ]) : result;fizzbuzz().map(x => console.log(x));
— I wonder how I'd do in an interview nowadays
— Why not forEach
— Does map do anything special that forEach doesn't for that use case?
— Eh, didn't really thing about it
— I just always use map, I doubt there's any overhead other than constructing a final array
— Since console.log is technically a side effect it doesn't really fit into my scheme anymore
— You could also just pass console.log without wrapping it
— Guys, quick question...
— I've been reading a little on polyfills and stuff