isNear.js 203 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 define(function(){ /** * Check if value is close to target. */ function isNear(val, target, threshold){ return (Math.abs(val - target) <= threshold); } return isNear; });