loop()

Progressively loops the values within an array on each iteration while at the same time retrieving one of the end values of the specified array.

This function is valid in v2.8.0 to v2.14.0. This function has been downloaded 41 times.

Parameters

{Array} array
Array from which to pull the value which will also be modified because the value will then be placed on the opposite end.
{boolean=} opt_reverse Optional, Default:false
Boolean indicating that instead of retrieving the first value, the last value should be retrieved and then placed at the beginning of array.

Returns

{*}
If opt_reverse is true-ish the last value in array will be returned and also placed at the beginning of array. Otherwise the first value in array will be returned and also placed at the end of array.