From a308d40fee81895dec24427c58082d8e56b8963f Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Fri, 5 Jan 2024 21:34:14 +0100 Subject: [PATCH] Passed final test from exercise 04 --- 04_removeFromArray/removeFromArray.js | 2 +- 04_removeFromArray/removeFromArray.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/04_removeFromArray/removeFromArray.js b/04_removeFromArray/removeFromArray.js index 5d7d6de..b3b2692 100644 --- a/04_removeFromArray/removeFromArray.js +++ b/04_removeFromArray/removeFromArray.js @@ -1,6 +1,6 @@ const removeFromArray = function(array, ...remove) { remove.forEach(element => { - let findIndexElement = array.findIndex(x => x == element); + let findIndexElement = array.findIndex(x => x === element); if (findIndexElement >= 0) { let saveArray = []; for (let i = 0, arrayLength = array.length; i < arrayLength - findIndexElement - 1; i++) { diff --git a/04_removeFromArray/removeFromArray.spec.js b/04_removeFromArray/removeFromArray.spec.js index 745a20f..c17239a 100644 --- a/04_removeFromArray/removeFromArray.spec.js +++ b/04_removeFromArray/removeFromArray.spec.js @@ -19,7 +19,7 @@ describe('removeFromArray', () => { test('works with strings', () => { expect(removeFromArray(["hey", 2, 3, "ho"], "hey", 3)).toEqual([2, "ho"]); }); - test.skip('only removes same type', () => { + test('only removes same type', () => { expect(removeFromArray([1, 2, 3], "1", 3)).toEqual([1, 2]); }); });