diff --git a/-/fastn-stack.github.io/fastn-js/lib.js b/-/fastn-stack.github.io/fastn-js/lib.js index 7fdc56c..fdccd66 100644 --- a/-/fastn-stack.github.io/fastn-js/lib.js +++ b/-/fastn-stack.github.io/fastn-js/lib.js @@ -7,3 +7,11 @@ function clampDecrement(a, by, min, max) { } a.set(newValue); } + +function getRange(min, max) { + const result = []; + for (let i = min.get(); i < max.get(); i++) { + result.push(i); + } + return fastn.mutableList(result); +} diff --git a/lib.js b/lib.js index 7fdc56c..fdccd66 100644 --- a/lib.js +++ b/lib.js @@ -7,3 +7,11 @@ function clampDecrement(a, by, min, max) { } a.set(newValue); } + +function getRange(min, max) { + const result = []; + for (let i = min.get(); i < max.get(); i++) { + result.push(i); + } + return fastn.mutableList(result); +} diff --git a/utils.ftd b/utils.ftd index df7c540..44e8963 100644 --- a/utils.ftd +++ b/utils.ftd @@ -49,3 +49,11 @@ integer max: 5 js: [$assets.files.lib.js] clampDecrement(a, by, min, max) + + +-- integer list range(min,max): +integer min: 0 +integer max: +js: [$assets.files.lib.js] + +getRange(min, max)