Test case details

Preparation Code

<script>   var   tArr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],         arrReverse = tArr.reverse;   function bizarroArrReverse(arr) {     for ( var idx = (arr.length - 2); idx >= 0; idx-- ) {       arr.push(arr[idx]);       arr.splice(idx, 1);     }     return arr;   }   function swapLoopArrReverse(arr) {     var   lIdx = 0,   rIdx = (arr.length - 1),   tmp;     for (lIdx, rIdx; lIdx < rIdx; lIdx++, rIdx--) {       tmp = arr[lIdx];       arr[lIdx] = arr[rIdx];       arr[rIdx] = tmp;     }     return arr;   } </script>

Test cases

Test #1

/* Since the focus here is on possible util methods that might conceivably be called on one or another weirdo arrLikeObjs, we gotta keep things generic... */ // ~ Equivalent to `[].reverse.call(tArr)` ~ arrReverse.call(tArr);

Test #2

// ~ Ops performed by called function ~ // for (length -= 2; length > -1; length -= 1) { //   array.push(array[length]); //   array.splice(length, 1); // } bizarroArrReverse(tArr);

Test #3

// ~ Ops performed by called function ~ // var   left = 0,   right = length - 1; // for (left, right; left < right; left += 1, right -= 1) { //   var temporary = array[left]; //   array[left] = array[right]; //   array[right] = temporary; // } swapLoopArrReverse(tArr);