compact(arr):Array
Returns a new Array without any null
or undefined
values. Note that it will keep empty strings and other falsy values (simillar to Ruby Array#compact).
contains(arr, value):Boolean
Checks if Array contains value. Alias to indexOf(arr, val) !== -1
.
every(arr, callback, [thisObj]):Array
Crossbrowser ES5 Array.every()
.
filter(arr, callback, [thisObj]):Array
Crossbrowser ES5 Array.filter()
.
forEach(arr, callback, [thisObj]):void
Crossbrowser ES5 Array.forEach()
.
indexOf(arr, item, [fromIndex]):Number
Crossbrowser ES5 Array.indexOf()
.
clamp(val, min, max):Number
Clamps value inside range.
countSteps(val, step, [overflow]):Number
Count number of full steps.
inRange(val, min, max, [threshold]):Boolean
Checks if value is inside the range.
isNear(val, target, threshold):Boolean
Check if value is close to target.
lerp(ratio, start, end):Number
Linear interpolation.
loop(val, min, max):Number
Loops value inside range. Will return min
if val > max
and max
if val < min
, otherwise it returns val
.
map(val, min1, max1, min2, max2):Number
Maps a number from one scale to another.
norm(val, min, max):Number
Gets normalized ratio of value inside range.
snap(val, step):Number
Snap value to full steps.