Comply with ESM. Convert live code example to Jest test.

This commit is contained in:
Eric Lavault
2021-10-09 13:25:34 +02:00
parent cbe7e0c89f
commit 3f32320c85
2 changed files with 20 additions and 18 deletions

View File

@@ -47,21 +47,4 @@ const combination = (n, r) => {
}
// Exports the functions to be used in other files.
module.exports.factorial = factorial
module.exports.permutation = permutation
module.exports.combination = combination
/**
* @example
const funcs = require("./PermutationAndCombination.js");
console.log(funcs.factorial(5));
console.log(funcs.permutation(5, 2));
console.log(funcs.combination(5, 2));
* @output
120
20
10
*/
export { factorial, permutation, combination }