Function rangeMap

from における value は to においていくつなのかをマッピングする

const result = rangeMap([0,100],[0,50],50);
console.log(result);
// 25