hof - sum-range in js