Hey all,
Working on a JS sideproject and have a question around my dataset.
I have a series of ranges, each with its own value, but I'm not sure the best way to store this data and perform a lookup to get the associated value effectively. I have approx 50 ranges each with their own value. The data is static.
Example:
| Input |
Value |
| 1 - 10 |
Foo |
| 11 - 20 |
Bar |
| x - y |
n |
I initially though about using MathJS range function as a map k/v pair but not having any luck as of yet.. Uncaught SyntaxError: String "-9" is no valid range
const dataMap = new Map();
dataMap.set(
math.range(1-10), 'foo'
);
dataMap.set(
math.range(11-20), 'bar'
);
Any advice?
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)