@function reverseArray

@description
immutably reverse the order of an array

@param {Array<*>} array the array to reverse
@returns {Array<*>} the reversed array
9691
function reverseArray(array) {
  let index = array.length,
      newArray = [];

  while (index--) {
    newArray.push(array[index]);
  }

  return newArray;
}
614652
function randomizeArray(array) {
  let i = array.length;
  while (i) {
    let j = Math.floor(Math.random() * i--);
    [array[i], array[j]] = [array[j], array[i]];
  }
  return array;
}
409218
function reverse (arrayLike) {
    var len = _toArrayLength(arrayLike.length);
    var result = Array(len);

    for (var i = 0, ofs = len - 1; i < len; i++) {
        result[i] = arrayLike[ofs - i];
    }

    return result;
}
455421
function( array ) {
			var i;
			if ( this.array ) {
				for ( i = 0; i < this.array.length; i++ ) {
					delete this.array[i];
				}
			}
			this.array = array;
			for ( i = 0; i < array.length; i++ ) {
				this[i] = this.array[i];
			}
			return this;
		}
930309
public static byte[] reverseByteArray(byte[] inputByteArray) {
	byte[] result=new byte[inputByteArray.length];
	for (int i=inputByteArray.length-1;i>=0;i--) {
		result[result.length-1-i]=inputByteArray[i];
	}
	return result;
}
1072818
private function array_reverse_iterator (array $a, $preserveKeys = false)
  {
    if ($preserveKeys)
      for (end ($a); ($key = key ($a)) !== null; prev ($a))
        yield $key => current ($a);
    else for (end ($a); ($key = key ($a)) !== null; prev ($a))
      yield current ($a);
  }
4786
private static Scriptable js_reverse(Context cx, Scriptable thisObj, Object[] args)
    {
        if (thisObj instanceof NativeArray) {
            NativeArray na = (NativeArray) thisObj;
            if (na.denseOnly) {
                for (int i=0, j=((int)na.length)-1; i < j; i++,j--) {
                    Object temp = na.dense[i];
                    na.dense[i] = na.dense[j];
                    na.dense[j] = temp;
                }
                return thisObj;
            }
        }
        long len = getLengthProperty(cx, thisObj, false);

        long half = len / 2;
        for(long i=0; i < half; i++) {
            long j = len - i - 1;
            Object temp1 = getRawElem(thisObj, i);
            Object temp2 = getRawElem(thisObj, j);
            setRawElem(cx, thisObj, i, temp2);
            setRawElem(cx, thisObj, j, temp1);
        }
        return thisObj;
    }
18967
function reverse(combos) {
  const { offsuit, suited, pairs } = sortOut(combos)

  const ps = reversePairs(pairs)
  const os = reverseNonPairs(offsuit, 'o')
  const su = reverseNonPairs(suited, 's')
  const nonpairs = unsuitWhenPossible(new Set(os), new Set(su))

  return ps.concat(nonpairs).join(', ')
}
963551
function (array) {
    var m = array.length, t, i;

    // While there remain elements to shuffle…
    while (m) {

      // Pick a remaining element…
      i = Math.floor(Math.random() * m--);

      // And swap it with the current element.
      t = array[m];
      array[m] = array[i];
      array[i] = t;
    }

    return array;
  }
420946
function(originalArray) {
            var cleanArray = [],
                i = -1;

            for (i = 0; i < originalArray.length; i++) {
                if (originalArray[i] !== '') {
                    cleanArray.push(originalArray[i]);
                }
            }

            return cleanArray;
        }
527985
function shuffleArray(array){
    var length = array.length;
    var randomIndex;
    var currentIndex = 0;
    var tmp;
    for (; currentIndex < length; currentIndex++) {
        randomIndex = Math.floor(Math.random() * length);
        tmp = array[currentIndex];
        array[currentIndex] = array[randomIndex];
        array[randomIndex] = tmp;
    }
    return array;
}
812627
function reverse(a) {
  var len = a.length;
  for (var i = 0; i < Math.floor(len/2); i++) {
    [a[i], a[len-i-1]] = [a[len-i-1], a[i]];
  }
  return a;
}
1073464
public static void sortArray(int[] array) {

        boolean swapped;

        do {
            swapped = false;

            for (int i = 0; i < array.length - 1; i++) {
                if (array[i] > array[i + 1]) {
                    int temp = array[i + 1];

                    array[i + 1] = array[i];
                    array[i]     = temp;
                    swapped      = true;
                }
            }
        } while (swapped);
    }
224080
function sortArrayByIndex(array) {

  let ii = 0;
  let length = array.length;

  let output = [];

  for (; ii < length; ++ii) {
    output[array[ii].index] = array[ii];
    delete array[ii].index;
  };

  return (output);

}
259737
function reverse(collection) {
    if (typeof collection === 'string') {
        return collection.split('').reverse().join('');
    }
    if(_.isArray(collection)){
        return collection.concat().reverse();
    }
    return collection;
}
555252
function walkRecursive(array, callback) {
	for (var i = 0, c = array.length; i < c; i++) {
		if (_.isObject(array[i].f)) {
			if (walkRecursive(array[i].f, callback) === false) {
				return false;
			}
		} else if (callback(array[i], i, array) === false) {
			return false;
		}
	}
}
607447
function last(array) {
      var length = array == null ? 0 : array.length;
      return length ? array[length - 1] : undefined$1;
    }