JSFunctionDeclaration factorial = program
.functionDeclaration("factorial");
// Add a function parameter
JSVariable x = factorial.parameter("x");
// Create an integer literal
JSDecimalIntegerLiteral one = codeModel.integer(1);
// Add a return statement to the function body
factorial.getBody()._return(
x.le(one).cond(
one,
x.mul(factorial.getFunctionExpression().i()