4 ms·
Personally, I think that if reduce is a single, reasonable length line, it's probably being used correctly. If it's a giant function, you're probably better off
by beatgammit 7y ago
Personally, I think that if reduce is a single, reasonable length line, it's probably being used correctly. If it's a giant function, you're probably better off just using a regular loop.
Use it when it's clear and elegant, don't when it's not. Unfortunately, relatively junior programmers try to force it because it seems like a cool tool to use.