Skip to content

compute incrmax

kgryte edited this page May 12, 2015 · 1 revision

Returns a method to compute a maximum value incrementally.

var data = [ 2, 4, 2, 7, 3 ];

var max = compute.incrmax(),
	m;

for ( var i = 0; i < data.length; i++ ) {
	m = max( data[ i ] );
	console.log( m );
}
console.log( max() );
Clone this wiki locally