Tell us what’s happening:
So my game plan here was to sort the two numbers in ascending order, then make an array of all the numbers between the two given numbers via a for loop, then add all those together using arr.reduce. I read the solution in the meantime and realize there’s a better way to do it, but I can’t figure out why my solution isn’t working. My attempted solution gave me an infinite loop warning, and I can’t seem to figure out why. I tried both a for and while loop and got the same error. There’s probably something super obvious I’m missing, but I can’t seem to hammer it down. Can someone set me straight? Here was my attempt:
Side note, I was having the function return inbetween in a debugging attempt.
Your code so far