Looking to find the sum of all numbers between two integers? I got you.
I love loops. For this problem I have used two “for” loops to solve the problem although there, as always, has to be a better way.
We will first need to create a variable, “nums”, that points to an empty array that we can push numbers to. After we create this variable we will use the first “for” loop to push all numbers between the two values into that array.
Assuming the two values were given to us as arguments we will call them “a’ and “b”. The…