js round any number before 10 to 10 code example Example: javascript round to nearest 10 var rounded = Math.round(number / 10) * 10