Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/marijnh/Eloquent-JavaScript
/ 04_1_the_sum_of_a_range.js
File
04_1_the_sum_of_a_range.js
code/solutions/04_1_the_sum_of_a_range.js:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
function
range(start, end, step = start < end ? 1 : -1) {
2
let
array = [];
3
4
if
(step > 0) {
Callers
nothing calls this directly
Calls
2
range
Function · 0.70
sum
Function · 0.70
Tested by
no test coverage detected