From c490fbd18760e9ebaec05651e56046e2b93b2368 Mon Sep 17 00:00:00 2001 From: hok7z Date: Sun, 22 Dec 2024 21:16:18 +0200 Subject: [PATCH] First commit --- Exercises/1-seq.js | 4 +++- Exercises/2-array.js | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Exercises/1-seq.js b/Exercises/1-seq.js index 0cc00a7..522569b 100644 --- a/Exercises/1-seq.js +++ b/Exercises/1-seq.js @@ -1,5 +1,7 @@ 'use strict'; -const seq = (f) => (g) => (x) => 0; +const seq = (f) => (g) => (x) => { + // idk how to do it... +}; module.exports = { seq }; diff --git a/Exercises/2-array.js b/Exercises/2-array.js index b6d47cf..95bbf49 100644 --- a/Exercises/2-array.js +++ b/Exercises/2-array.js @@ -1,5 +1,12 @@ 'use strict'; -const array = () => null; +const array = () => { + const arr = []; + + array.push = (value) => arr.push(value); + array.pop = () => arr.pop(); + + return (i) => arr[i]; +}; module.exports = { array };