2 ms·
FP works very well in short simple examples. If the for loop would be any more complex the FP solution would probable be incomprehensible. Optimizers however lo
by z3t4 7y ago
FP works very well in short simple examples. If the for loop would be any more complex the FP solution would probable be incomprehensible.
Optimizers however love small immutable and steteless functions so FP would likely be faster then the imperative version. For example by making it run parallel, caching, inlining, etc
- layoutIfNeeded 7y ago>FP would likely be faster then the imperative version [citation needed] I highly doubt that even the most sophisticated JS engines would produce faster machine code from the functional spaghetti than a simple for loop.