Snaps a value to the nearest value in an array.
Snaps a value to the nearest value in an array.
The search value
The input array which must be sorted.
The nearest value found.
Fetch a random entry from the given array.
Fetch a random entry from the given array. Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index.
An array of objects.
Optional offset off the front of the array. Default value is 0, or the beginning of the array.
Optional restriction on the number of values you want to randomly select from.
The random object that was selected.
Create an array representing the inclusive range of numbers (usually integers) in [start, end].
Create an array representing the inclusive range of numbers (usually integers) in [start, end].
This is equivalent to numberArrayStep(start, end, 1)
.
The minimum value the array starts with.
The maximum value the array contains.
The array of number values.
Create an array of numbers (positive and/or negative) progressing from start up to but not including end by advancing by step.
Create an array of numbers (positive and/or negative) progressing from start up to but not including end by advancing by step. If start is less than end a zero-length range is created unless a negative step is specified. Certain values for start and end (eg. NaN/undefined/null) are currently coerced to 0; for forward compatibility make sure to pass in actual numbers.
The start of the range.
The end of the range.
The value to increment or decrement by.
Returns the new array of numbers.
Removes a random object from the given array and returns it.
Removes a random object from the given array and returns it. Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index.
An array of objects.
Optional offset off the front of the array. Default value is 0, or the beginning of the array.
Optional restriction on the number of values you want to randomly select from.
The random object that was removed.
Moves the element from the start of the array to the end, shifting all items in the process.
Moves the element from the start of the array to the end, shifting all items in the process. The "rotation" happens to the left.
The array to rotate. The array is modified.
The rotated value.
Rotates the given matrix (array of arrays).
Rotates the given matrix (array of arrays).
The array to rotate; this matrix may be altered.
The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').
The rotated matrix. The source matrix should be discarded for the returned matrix.
http://jsfiddle.net/MrPolywhirl/NH42z/.
Moves the element from the end of the array to the start, shifting all items in the process.
Moves the element from the end of the array to the start, shifting all items in the process. The "rotation" happens to the right.
The array to rotate. The array is modified.
The shifted value.
A standard Fisher-Yates Array shuffle implementation which modifies the array in place.
A standard Fisher-Yates Array shuffle implementation which modifies the array in place.
The array to shuffle.
The original array, now shuffled.
Transposes the elements of the given matrix (array of arrays).
Transposes the elements of the given matrix (array of arrays).
The matrix to transpose.
A new transposed matrix
Moves the element from the start of the array to the end, shifting all items in the process.
Moves the element from the start of the array to the end, shifting all items in the process. The "rotation" happens to the left.
The array to rotate. The array is modified.
The rotated value.
(Since version 2.6.2) This method is deprecated and should not be used. It may be removed in the future.
Array Utils Singleton