0
I’m trying to subtract values from a array in Javascript, but not a subtraction of a given value array on the other hand.
I want to do this: I have one array any that brings me real values from my bank. In this case I will put one to exemplify:
var arrayExemplo = [2, 5, 9, 10, 15];
I want to subtract
- element 5 by element 2
- element 9 by element 5
- element 10 for element 9
- element 15 by element 10
I want my results to come out
[3, 4, 1, 5]
How can I do?
Isn’t it a complex task, what you’ve been trying to do? We can help you with the parts you doubt or didn’t get
– BrTkCa