MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / range

Method range

src/danfojs-base/shared/utils.ts:124–138  ·  view source on GitHub ↗

* Generates an array of integers between specified range * @param start The starting number. * @param end The ending number.

(start: number, end: number)

Source from the content-addressed store, hash-verified

122 * @param end The ending number.
123 */
124 range(start: number, end: number): Array<number> {
125 if (end < start) {
126 throw new Error("ParamError: end must be greater than start")
127 }
128
129 if (start === end) {
130 return [start]
131 }
132
133 const arr = [];
134 for (let i = start; i <= end; i++) {
135 arr.push(i);
136 }
137 return arr;
138 }
139
140 /**
141 * Checks if object has the specified key

Callers 2

utils.test.jsFile · 0.45
utils.test.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected