From 0fb90a17cd2e6cb0153f474b454d276443e17e6d Mon Sep 17 00:00:00 2001
From: Fredrik Uddenfeldt <fredrikuddenfeldt@fredriks-air.lan>
Date: Sat, 20 May 2023 20:52:30 +0200
Subject: [PATCH] third iteration

---
 04_removeFromArray/removeFromArray.js | 31 +++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/04_removeFromArray/removeFromArray.js b/04_removeFromArray/removeFromArray.js
index 790bd7a..ea235fc 100644
--- a/04_removeFromArray/removeFromArray.js
+++ b/04_removeFromArray/removeFromArray.js
@@ -1,3 +1,34 @@
+// Third iteration:
+
+const removeFromArray = function([a, ...b], c, ...d) { 
+  let firstArray = [a, ...b];
+  let secondArray = [c, ...d];
+  console.table(firstArray);
+  console.table(secondArray);
+
+  let combinedArray = [...firstArray, ...secondArray];
+
+let removeDuplicates = [...new Set(combinedArray)]
+
+}
+
+removeFromArray(["a", "b", "c", "d"], "e", "f", "g")
+
+// Need to figure out how to turn second parameter into an array
+
+/*
+const removeFromArray = function([arrayOne], arrayTwo) { 
+
+  function f(a, ...arrayTwo) {
+    let newArray = [...arrayTwo];
+    console.table(newArray)
+    return newArray
+  }
+
+}
+*/ 
+
+
 // Second iteration that fails test but can remove duplicates from arrays:
 
 const removeFromArray = function([arrayOne], [arrayTwo]) {