Home > Software engineering >  JS function automatically increases value of variable [closed]
JS function automatically increases value of variable [closed]

Time:09-17

My Problem

My goal with this function was to shift all elements to the right, and the last element to the first position (performing a rotation). Where c determined the number of times the action had to be performed (c=0 means to return the list as it is). But for some reason the value of c increases (from 0 to 1) instead of returning the list as it is. Why does the value of c increases?, when it should decrease or be zero. I have been struggling with this problem for many days

  • Related