From 32d0a9d40c535541e02de13d9b9bd283449a340c Mon Sep 17 00:00:00 2001 From: Megan Poosangtongchai Date: Wed, 24 Jan 2018 03:29:13 +0000 Subject: [PATCH 1/2] Done. --- index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/index.js b/index.js index e69de29..6b1e3b4 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,20 @@ + +function add(a, b) { + return a + b; +} + +function subtract(a, b) { + return a - b; +} + +function multiply(a, b) { + return a * b; +} + +function divide(a, b) { + return a / b; +} + +function inc(a) { + return inc(a) = (a+1); +} \ No newline at end of file From 584b7810a11b67758c14d4fad72db85d047c8870 Mon Sep 17 00:00:00 2001 From: Megan Poosangtongchai Date: Wed, 24 Jan 2018 04:53:11 +0000 Subject: [PATCH 2/2] Done. --- index.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 6b1e3b4..7738d1e 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,3 @@ - function add(a, b) { return a + b; } @@ -15,6 +14,18 @@ function divide(a, b) { return a / b; } -function inc(a) { - return inc(a) = (a+1); +function inc(n) { + return n += 1; +} + +function dec(n) { + return n -= 1; +} + +function makeInt(n) { + return parseInt(n, 10); +} + +function preserveDecimal(n) { + return parseFloat(n); } \ No newline at end of file