From 693886265d4c2cf3a8f7a529008858fb77f35262 Mon Sep 17 00:00:00 2001 From: EricTheWebDev Date: Mon, 1 Apr 2024 14:44:39 -0500 Subject: [PATCH 1/4] solved addb function --- Solutions/ItzJustEric.js | 108 +++++++++++++++++++++++++++++++++++++++ package-lock.json | 6 +-- 2 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 Solutions/ItzJustEric.js diff --git a/Solutions/ItzJustEric.js b/Solutions/ItzJustEric.js new file mode 100644 index 0000000..10493bc --- /dev/null +++ b/Solutions/ItzJustEric.js @@ -0,0 +1,108 @@ +// identity(x) ⇒ any +// Write a function identity that takes an argument and returns that argument + + +//Write a binary function addb that takes two numbers and returns their sum +addb = (x,y) => { + return x + y + +} + + + + + + + + + + + + + + + + + + +module.exports = { + identity, + addb, + subb, + mulb, + minb, + maxb, + add, + sub, + mul, + min, + max, + addRecurse, + mulRecurse, + minRecurse, + maxRecurse, + not, + acc, + accPartial, + accRecurse, + fill, + fillRecurse, + set, + identityf, + addf, + liftf, + pure, + curryb, + curry, + inc, + twiceUnary, + doubl, + square, + twice, + reverseb, + reverse, + composeuTwo, + composeu, + composeb, + composeTwo, + compose, + limitb, + limit, + genFrom, + genTo, + genFromTo, + elementGen, + element, + collect, + filter, + filterTail, + concatTwo, + concat, + concatTail, + gensymf, + gensymff, + fibonaccif, + counter, + revocableb, + revocable, + extract, + m, + addmTwo, + addm, + liftmbM, + liftmb, + liftm, + exp, + expn, + addg, + liftg, + arrayg, + continuizeu, + continuize, + vector, + exploitVector, + vectorSafe, + pubsub, + mapRecurse, + filterRecurse, +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 06cf353..f726029 100644 --- a/package-lock.json +++ b/package-lock.json @@ -429,9 +429,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" From c5c3d38c0fe816f5ce098bfaac9d52b4d4b33e93 Mon Sep 17 00:00:00 2001 From: EricTheWebDev Date: Mon, 1 Apr 2024 16:23:50 -0500 Subject: [PATCH 2/4] solved 2nd function --- JS_Fun_Practice | 1 + Solutions/ItzMeEriccc_solution.js | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 160000 JS_Fun_Practice create mode 100644 Solutions/ItzMeEriccc_solution.js diff --git a/JS_Fun_Practice b/JS_Fun_Practice new file mode 160000 index 0000000..dfd64fa --- /dev/null +++ b/JS_Fun_Practice @@ -0,0 +1 @@ +Subproject commit dfd64fa5f66bbd6bb9a1d4b14c13416440866a89 diff --git a/Solutions/ItzMeEriccc_solution.js b/Solutions/ItzMeEriccc_solution.js new file mode 100644 index 0000000..33e8960 --- /dev/null +++ b/Solutions/ItzMeEriccc_solution.js @@ -0,0 +1,8 @@ +// Write a function identity that takes an argument and returns that argument + + +//Write a binary function addb that takes two numbers and returns their sum +addb = (a,b) => { + return a + b + +} \ No newline at end of file From e3dd7d2a2a640edd0eb8465a2029106e0491f81f Mon Sep 17 00:00:00 2001 From: EricTheWebDev Date: Mon, 1 Apr 2024 16:29:17 -0500 Subject: [PATCH 3/4] solved 2nd function --- Solutions/ItzJustEric.js | 4 ++-- Solutions/ItzMeEriccc_solution.js | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 Solutions/ItzMeEriccc_solution.js diff --git a/Solutions/ItzJustEric.js b/Solutions/ItzJustEric.js index 10493bc..2727480 100644 --- a/Solutions/ItzJustEric.js +++ b/Solutions/ItzJustEric.js @@ -3,8 +3,8 @@ //Write a binary function addb that takes two numbers and returns their sum -addb = (x,y) => { - return x + y +addb = (a,b) => { + return a + b } diff --git a/Solutions/ItzMeEriccc_solution.js b/Solutions/ItzMeEriccc_solution.js deleted file mode 100644 index 33e8960..0000000 --- a/Solutions/ItzMeEriccc_solution.js +++ /dev/null @@ -1,8 +0,0 @@ -// Write a function identity that takes an argument and returns that argument - - -//Write a binary function addb that takes two numbers and returns their sum -addb = (a,b) => { - return a + b - -} \ No newline at end of file From fc9bfe598a0ff7dab652068e2f8bd5db545bfd12 Mon Sep 17 00:00:00 2001 From: eameyaw2 Date: Mon, 1 Apr 2024 17:28:01 -0500 Subject: [PATCH 4/4] solved first 3 functions --- Solutions/ItzJustEric.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Solutions/ItzJustEric.js b/Solutions/ItzJustEric.js index 2727480..f311d7d 100644 --- a/Solutions/ItzJustEric.js +++ b/Solutions/ItzJustEric.js @@ -1,5 +1,8 @@ // identity(x) ⇒ any -// Write a function identity that takes an argument and returns that argument + +identity = (x) => { + return x +} //Write a binary function addb that takes two numbers and returns their sum @@ -9,7 +12,11 @@ addb = (a,b) => { } +//subb(a, b) ⇒ number Write a binary function subb that takes two numbers and returns their difference +subb = (a,b) => { + return a - b +}