Given the input of string 6-10, I want to obtain a list of numbers [6,6.5,7,7.5,8,8.5,9,9.5,10].
This is what I have come up with:
const x = "6-10";
const sizeMinMax = R.pipe(R.split('-'), R.map(parseInt))
sizeMinMax(x); //[6,10]
const sizesStepped = (min, max) => R.unfold(minSize => minSize > max ? false : [minSize, minSize + 0.5], min)
sizesStepped(8,10); // [8,8.5,9,9.5,10]
How do I pipe the output of sizeMinMax(x) which is an array to sizeStepped function with 2 arguments?
sizesStepped.apply(null, sizeMinMax(x));var sizesStepped = (min, max) => Array.from({length: (max - min) * 2 + 1}, (_, i) => min + i*0.5)