You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
384 B

import { isEven } from './evens';
export function nextOdd(n) {
return isEven(n) ? n + 1 : n + 2;
}
/**
* We go through these gymnastics to eager-bind to isEven. This is done to
* ensure that both this module and the 'evens' module eagerly use something
* from the other.
*/
export var isOdd = (function(isEven) {
return function(n) {
return !isEven(n);
};
})(isEven);