julien-c's picture
julien-c HF staff
do not gitignore the builds
6cd9596
raw
history blame
517 Bytes
/**
* @author mrdoob / http://mrdoob.com/
*/
function arrayMin( array ) {
if ( array.length === 0 ) return Infinity;
var min = array[ 0 ];
for ( var i = 1, l = array.length; i < l; ++ i ) {
if ( array[ i ] < min ) min = array[ i ];
}
return min;
}
function arrayMax( array ) {
if ( array.length === 0 ) return - Infinity;
var max = array[ 0 ];
for ( var i = 1, l = array.length; i < l; ++ i ) {
if ( array[ i ] > max ) max = array[ i ];
}
return max;
}
export { arrayMin, arrayMax };