demo/dist/demo.js
function closest(array, value) {
	  if (!is$1.array(array) || !array.length) {
	    return null;
	  }

	  return array.reduce(function (prev, curr) {
	    return Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev;
	  });
	}
function closest(array, value) {
	  if (!is$1.array(array) || !array.length) {
	    return null;
	  }

	  return array.reduce(function (prev, curr) {
	    return Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev;
	  });
	}
function closest ( array , value ) { if ( ! is$1 . array ( array ) || ! array . length ) { return null ; } return array . reduce ( function ( prev , curr ) { return Math . abs ( curr - value ) < Math . abs ( prev - value ) ? curr : prev ; } ) ; }
Get the closest value in an array
Get the closest value in an array