Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
arrow solution in Clear category for Nearest Value by nicolas.tscherter
var nearestValue = (v, search, _) => (
_ = v.sort((a,b) => a-b).map(x => (x-search)**2),
v[_.indexOf(Math.min(..._))]
)
June 17, 2020
Comments: