0
I need to use the reduce
in Javascript, because I need to sum several simultaneous values that are contained in an array.
As I am using Typescript (Ionic3), the types of these variables are number
, and not float
or double
.
When I execute reduce
with integer numbers, everything goes well and returns the sum value.
But when I execute a decimal value for example 10,00 + 10,00 he returns me NAN.
Is there any difference between performing a reduce
of decimal and integer values?
The right thing wouldn’t be
10.00
?– Marconi
Show the code where the sum is made.
– Jéf Bueno