Debian Codegraph @

js/src/jit-test/modules/isOdd.js

raw
1 import { isEven } from "isEven.js"
2
3 export function isOdd(x) {
4 if (x < 0)
5 throw "negative";
6 if (x == 0)
7 return false;
8 return isEven(x - 1);
9 }
10
11 assertEq(isEven(4), true);
12 assertEq(isOdd(5), true);