repl.txt (746B)
1 2 {{alias}}() 3 Returns an accumulator function which incrementally computes a sum of 4 absolute values, ignoring NaN values. 5 6 If provided a value, the accumulator function returns an updated sum. If not 7 provided a value, the accumulator function returns the current sum. 8 9 For long running accumulations or accumulations of large numbers, care 10 should be taken to prevent overflow. 11 12 Returns 13 ------- 14 acc: Function 15 Accumulator function. 16 17 Examples 18 -------- 19 > var accumulator = {{alias}}(); 20 > var s = accumulator() 21 null 22 > s = accumulator( 2.0 ) 23 2.0 24 > s = accumulator( NaN ) 25 2.0 26 > s = accumulator( -5.0 ) 27 7.0 28 > s = accumulator() 29 7.0 30 31 See Also 32 -------- 33