remove timer and simon

This commit is contained in:
Cody Loyd
2017-12-15 12:56:14 -06:00
parent 14cc7d40bd
commit 834d78b8b2
2928 changed files with 303453 additions and 313 deletions
+24 -19
View File
@@ -1,32 +1,37 @@
function add () {
function add(a, b) {
return a + b;
}
function subtract () {
function subtract(a, b) {
return a - b;
}
function sum () {
function sum(array) {
return array.reduce((current, total) => total + current, 0);
}
function multiply () {
function multiply(array) {
return array.reduce((current, total) => total * current, 1);
}
function power() {
function power(a, b) {
return Math.pow(a, b);
}
function factorial() {
function factorial(n) {
if (n == 0) return 0;
let product = 1;
for (let i = n; i > 0; i--) {
product *= i;
}
return product;
}
module.exports = {
add,
subtract,
sum,
multiply,
power,
factorial
}
add,
subtract,
sum,
multiply,
power,
factorial
};