3 ms·
My original reply was just before heading to bed, but I have a real question for you: Do you think this is FP specific? > Even the example given in the OP, it
by Jtsummers 4y ago
My original reply was just before heading to bed, but I have a real question for you: Do you think this is FP specific?
> Even the example given in the OP, it assumes that the "+" operator will work correctly for all of the data entries. What if one of my inputs was an imaginary number? What if I want special treatment for specific entries?
Do you really think only functional programming encounters the situation where the data may not all be valid? You think that this imperative style JS is going to work any better on heterogenous data:
sum = 0
for(const item of data)
sum = sum + data
That's going to fail in the same way, and it's not functional, just imperative. So what is your argument about FP here?