UNPKG

@thi.ng/transducers-stats

Version:

Transducers for statistical / technical analysis

14 lines (13 loc) 247 B
const bounds = (window) => { let min = window[0]; let max = min; for (let i = window.length - 1; i > 0; i--) { const v = window[i]; min = Math.min(min, v); max = Math.max(max, v); } return [min, max]; }; export { bounds };