countSteps.js 277 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 define(function(){ /** * Count number of full steps. */ function countSteps(val, step, overflow){ val = Math.floor(val / step); if (overflow) { return val % overflow; } return val; } return countSteps; });