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?