Sign in
cobalt
/
cobalt
/
c73ce7d5dfce7ae20bcc30efc5f220e0fbac12b1
/
.
/
src
/
third_party
/
mozjs-45
/
js
/
src
/
jit-test
/
modules
/
isOdd.js
blob: 2cada0cf939a1df605bd276dbd9ab18edb264a7d [
file
] [
log
] [
blame
]
import
{
isEven
}
from
"isEven.js"
export
function
isOdd
(
x
)
{
if
(
x
<
0
)
throw
"negative"
;
if
(
x
==
0
)
return
false
;
return
isEven
(
x
-
1
);
}
assertEq
(
isEven
(
4
),
true
);
assertEq
(
isOdd
(
5
),
true
);