UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

15 lines (14 loc) 277 B
/** * * Returns next odd value or input if already odd * @param {number} x integer * @return {number} odd integer */ export function nextOdd(x) { if (x % 2 === 0) { // even, make odd return x + 1; } // already odd return x; }