How to make a reduction of decimal values?

0

I need to use the reduce method in JavaScript, since I need to sum the multiple concurrent values that are contained in an array.

As I'm using TypeScript (Ionic3), the types of these variables are number , not float or double .

When I run reduce with integers, everything works fine and returns the sum value.

But when I run a decimal value for example 10,00 + 10,00 it returns me NAN.

Is there any difference between making a% of decimal and integer values?

    
asked by anonymous 24.09.2018 / 21:53

0 answers