Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Array & sort 🧠solution in Clear category for Nearest Value by zborde
var nearestValue = (v: number[], s: number): number =>
v.sort( (a,b) => Math.abs( s-a) - Math.abs(s-b) || a-b )[0];
April 25, 2020
Comments: