mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-10-30 12:31:17 +00:00
17 lines
463 B
JavaScript
17 lines
463 B
JavaScript
define(function() {
|
|
/**
|
|
* roundedEquals takes two integers and checks if the first is within 1 of the second
|
|
*
|
|
* @access private
|
|
* @function roundedEquals
|
|
* @param {number} a - first integer
|
|
* @param {number} b - second integer
|
|
* @returns {boolean} true if the first integer is within 1 of the second, false otherwise
|
|
*/
|
|
function roundedEquals(a, b) {
|
|
return a - 1 === b || a === b || a + 1 === b;
|
|
}
|
|
|
|
return roundedEquals;
|
|
});
|