CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
range.mjs18 linesDownload Raw Back to math
1function range(start, end, step = 1) {2    if (end == null) {3        end = start;4        start = 0;5    }6    if (!Number.isInteger(step) || step === 0) {7        throw new Error(`The step value must be a non-zero integer.`);8    }9    const length = Math.max(Math.ceil((end - start) / step), 0);10    const result = new Array(length);11    for (let i = 0; i < length; i++) {12        result[i] = start + i * step;13    }14    return result;15}16 17export { range };18 
basant307/AI_Governance_Project · CoolFace