I am building array of values which will be typed into input field. Array looks like this example:
[{mykey:"32"},{mykey:"32"}]
I tried to calculate sum of it with this example:
reduce(function(prev2, cur) {
return prev2 + cur.mykey;
}, 0);
But it only put numbers behind. And don`t calculate. Maybe my array should look like this to calculate? How to get right input as number instead of string?
[{mykey:32},{mykey:32}]