Function map decrease

Tell us what’s happening:
Describe your issue in detail here.
how to decrease a variable by -1 for each cycle???
in this case is the variable j but this variable doesn’t decrease in my code.

   **Your code so far**

function sumAll(arr) {,i,item)=>{
  let j = item.length-1;

 return 1;

sumAll([1, 4]);
   **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36

Challenge: Sum All Numbers in a Range

Link to the challenge:

I don’t understand what you are trying to do, but you should not use a map as if it is a forEach. A map should only be used to make a new array from the contents of an old array.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.