MCPcopy Create free account
hub / github.com/codecombat/codecombat / __range__

Function __range__

spec/aether/es6_spec.js:1458–1466  ·  view source on GitHub ↗
(left, right, inclusive)

Source from the content-addressed store, hash-verified

1456
1457
1458function __range__(left, right, inclusive) {
1459 let range = [];
1460 let ascending = left < right;
1461 let end = !inclusive ? right : ascending ? right + 1 : right - 1;
1462 for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) {
1463 range.push(i);
1464 }
1465 return range;
1466}

Callers 1

es6_spec.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected