From d26abd5a91976b9ca509ebb6a3eb090a08e0d624 Mon Sep 17 00:00:00 2001 From: Mehmet Sonmezates Date: Mon, 24 Jul 2017 19:30:35 -0500 Subject: [PATCH] finish module assignment --- .eslintrc | 2 +- src/index.js | 5 +++-- src/modules/addNumbers.js | 4 ++++ src/modules/divide.js | 5 +++++ src/modules/multiply.js | 5 +++++ src/modules/subtract.js | 4 ++++ src/modules/subtractNumbers.js | 13 +++++++++++++ 7 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 src/modules/divide.js create mode 100644 src/modules/multiply.js create mode 100644 src/modules/subtractNumbers.js diff --git a/.eslintrc b/.eslintrc index ee54d86..577e479 100644 --- a/.eslintrc +++ b/.eslintrc @@ -94,7 +94,7 @@ "no-catch-shadow": 0, "no-class-assign": 2, "no-cond-assign": 2, - "no-console": 1, + "no-console": 0, "no-const-assign": 2, "no-constant-condition": 2, "no-continue": 0, diff --git a/src/index.js b/src/index.js index d2e3a10..2051aa5 100644 --- a/src/index.js +++ b/src/index.js @@ -1,8 +1,9 @@ import add from "./modules/add"; import subtract from "./modules/subtract"; import multiply from "./modules/multiply"; -import {addTen, addFive} from "./modules/addNumbers"; -import {subtractOne} from "./modules/subtractNumbers"; +import {addTen, addFive, addOne} from "./modules/addNumbers"; +import {subtractOne, subtractFive, subtractTen} from "./modules/subtractNumbers"; +import divide from "./modules/divide"; const number1 = 393; const number2 = 238; diff --git a/src/modules/addNumbers.js b/src/modules/addNumbers.js index d879077..42c9f92 100644 --- a/src/modules/addNumbers.js +++ b/src/modules/addNumbers.js @@ -7,3 +7,7 @@ export function addTen(num) { export function addFive(num) { return add(num, 5); } + +export function addOne(num) { + return add(num, 1); +} diff --git a/src/modules/divide.js b/src/modules/divide.js new file mode 100644 index 0000000..81db903 --- /dev/null +++ b/src/modules/divide.js @@ -0,0 +1,5 @@ +function divide(num1,num2) { + return num1 / num2; +} + +export default divide; diff --git a/src/modules/multiply.js b/src/modules/multiply.js new file mode 100644 index 0000000..f952dfa --- /dev/null +++ b/src/modules/multiply.js @@ -0,0 +1,5 @@ +function multiply(num1, num2) { + return num1 * num2; +} + +export default multiply; diff --git a/src/modules/subtract.js b/src/modules/subtract.js index e69de29..907c262 100644 --- a/src/modules/subtract.js +++ b/src/modules/subtract.js @@ -0,0 +1,4 @@ +function subtract(num1,num2) { + return num1 - num2; +} +export default subtract; diff --git a/src/modules/subtractNumbers.js b/src/modules/subtractNumbers.js new file mode 100644 index 0000000..6c4c480 --- /dev/null +++ b/src/modules/subtractNumbers.js @@ -0,0 +1,13 @@ +import subtract from "./subtract"; + +export function subtractOne(num) { + return subtract(num, 1); +} + +export function subtractFive(num) { + return subtract(num, 1); +} + +export function subtractTen(num) { + return subtract(num, 1); +}