From 0941db37a7fbf41153e4e1ee3ba6660d57862861 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 10:29:26 +0100 Subject: [PATCH 01/34] installed jest as a dev dependency and fix other issue with npm install --save-dev jest && npm audit fix --- Sprint-1/package-lock.json | 460 ++++++++++++++----------------------- 1 file changed, 171 insertions(+), 289 deletions(-) diff --git a/Sprint-1/package-lock.json b/Sprint-1/package-lock.json index 83e427d0b..22bb04965 100644 --- a/Sprint-1/package-lock.json +++ b/Sprint-1/package-lock.json @@ -12,38 +12,25 @@ "jest": "^29.7.0" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/code-frame": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", - "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/highlight": "^7.25.7", - "picocolors": "^1.0.0" + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.8.tgz", - "integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, "license": "MIT", "engines": { @@ -51,22 +38,22 @@ } }, "node_modules/@babel/core": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.8.tgz", - "integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/helper-compilation-targets": "^7.25.7", - "@babel/helper-module-transforms": "^7.25.7", - "@babel/helpers": "^7.25.7", - "@babel/parser": "^7.25.8", - "@babel/template": "^7.25.7", - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.8", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -82,15 +69,16 @@ } }, "node_modules/@babel/generator": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", - "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.7", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" }, "engines": { @@ -98,14 +86,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz", - "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.7", - "@babel/helper-validator-option": "^7.25.7", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -114,31 +102,40 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", - "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", - "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.7", - "@babel/helper-simple-access": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "@babel/traverse": "^7.25.7" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -157,24 +154,10 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz", - "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", - "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "dev": true, "license": "MIT", "engines": { @@ -182,9 +165,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", - "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, "license": "MIT", "engines": { @@ -192,9 +175,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", - "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, "license": "MIT", "engines": { @@ -202,121 +185,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.7.tgz", - "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", - "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/parser": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", - "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.8" + "@babel/types": "^7.29.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -565,49 +454,48 @@ } }, "node_modules/@babel/template": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", - "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", - "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7", - "debug": "^4.3.1", - "globals": "^11.1.0" + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", - "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -940,34 +828,31 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", "dev": true, "license": "MIT", - "engines": { - "node": ">=6.0.0" + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", "engines": { @@ -982,9 +867,9 @@ "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "license": "MIT", "dependencies": { @@ -1324,10 +1209,23 @@ "dev": true, "license": "MIT" }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.0.tgz", + "integrity": "sha512-oCu2wfipvX3AePSgmOuKkIywOu+8n9psz7hXYmk56ghpu3+7KzNIBopaOs4c9BrtdnTtW30unG9GTfHo7EwERQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", + "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", "dev": true, "license": "MIT", "dependencies": { @@ -1349,9 +1247,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", - "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", + "version": "4.28.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.7.tgz", + "integrity": "sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==", "dev": true, "funding": [ { @@ -1369,10 +1267,11 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001663", - "electron-to-chromium": "^1.5.28", - "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.0" + "baseline-browser-mapping": "^2.10.44", + "caniuse-lite": "^1.0.30001806", + "electron-to-chromium": "^1.5.393", + "node-releases": "^2.0.51", + "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" @@ -1419,9 +1318,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001667", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001667.tgz", - "integrity": "sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==", + "version": "1.0.30001806", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz", + "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==", "dev": true, "funding": [ { @@ -1579,9 +1478,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "dependencies": { @@ -1657,9 +1556,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.35", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.35.tgz", - "integrity": "sha512-hOSRInrIDm0Brzp4IHW2F/VM+638qOL2CzE0DgpnGzKW27C95IqqeqgKz/hxHGnvPxvQGpHUGD5qRVC9EZY2+A==", + "version": "1.5.395", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.395.tgz", + "integrity": "sha512-7zt9Aw+SrmxLWLN0zhaTWZQiCdryLVrYTq5R7iZakLvi2UQPYMMsROYV/2qVCzMeCiSXHwKOU+sZ4zOVVlrtKA==", "dev": true, "license": "ISC" }, @@ -1918,16 +1817,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2785,9 +2674,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.0.tgz", + "integrity": "sha512-ttBQIIQPDeLjpPOohtUdXuXUVoA2uIB6fEH9HyJ7234s5mBJ5wTx20njxplLZQgLaOfpmPQA7X2t5AX6tIPbog==", "dev": true, "license": "MIT", "dependencies": { @@ -2952,9 +2841,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -2986,11 +2875,14 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/normalize-path": { "version": "3.0.0", @@ -3153,16 +3045,16 @@ "license": "MIT" }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -3543,16 +3435,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3597,9 +3479,9 @@ "license": "MIT" }, "node_modules/update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", "dev": true, "funding": [ { @@ -3618,7 +3500,7 @@ "license": "MIT", "dependencies": { "escalade": "^3.2.0", - "picocolors": "^1.1.0" + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" From c61d25fe168918246a43729bb304e49694df590d Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 13:40:20 +0100 Subject: [PATCH 02/34] remove splice method to avoid mutating the arrays --- Sprint-1/fix/median.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index b22590bc6..83cb97e4a 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -7,7 +7,7 @@ function calculateMedian(list) { const middleIndex = Math.floor(list.length / 2); - const median = list.splice(middleIndex, 1)[0]; + const median = list[middleIndex]; return median; } From d2aad9268dddc4c832a7c3e6ed6143750aa2b1d6 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 13:44:43 +0100 Subject: [PATCH 03/34] implement ststement to validate that input data are arrays --- Sprint-1/fix/median.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index 83cb97e4a..8684bcb51 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -6,6 +6,10 @@ // or 'list' has mixed values (the function is expected to sort only numbers). function calculateMedian(list) { + // validate that the datetype is arrays + if(!Array.isArray(list)){ + return null; + } const middleIndex = Math.floor(list.length / 2); const median = list[middleIndex]; return median; From e01bb4eab9ee41c0285ca96d28653544fe3026bd Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 14:11:45 +0100 Subject: [PATCH 04/34] implement a statement to convert numerical strings to numbers and ignores non-numerical values --- Sprint-1/fix/median.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index 8684bcb51..c5501a5be 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -7,9 +7,20 @@ function calculateMedian(list) { // validate that the datetype is arrays - if(!Array.isArray(list)){ + if (!Array.isArray(list)) { return null; } + // Convert numeric strings to numbers and ignore non-numeric values + const numericValue = list + .map(item=>{ + // convert numerical string to number + if(typeof item ==="string" && item.trim()!==""&& !isNaN(item)){ + return Number(item); + } + return item; + } ) + // Filter every arrays that is now a number + .filter(item =>typeof item==="number"&& !isNaN(item)); const middleIndex = Math.floor(list.length / 2); const median = list[middleIndex]; return median; From 10f38f1e03eb3cd6477814daa45e421d9e18bb16 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 14:17:13 +0100 Subject: [PATCH 05/34] validates that the dataset contains numbers --- Sprint-1/fix/median.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index c5501a5be..5f4ff8910 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -21,6 +21,10 @@ function calculateMedian(list) { } ) // Filter every arrays that is now a number .filter(item =>typeof item==="number"&& !isNaN(item)); + // Validates if the Arrays has any numerical values at all + if (numericValue.length===0){ + return null; + } const middleIndex = Math.floor(list.length / 2); const median = list[middleIndex]; return median; From 1a961a0ace5755d4320c4d9aa88928630f9fd623 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 14:34:59 +0100 Subject: [PATCH 06/34] implements method to sort the numeric numbers in ascending order --- Sprint-1/fix/median.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index 5f4ff8910..e0dd49425 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -25,6 +25,8 @@ function calculateMedian(list) { if (numericValue.length===0){ return null; } + // sorting the numeric data in ascending order + numericValue.sort((a,b)=>a-b); const middleIndex = Math.floor(list.length / 2); const median = list[middleIndex]; return median; From cd7c633dd3c013164c72200f50f14defd760c2a5 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 14:38:27 +0100 Subject: [PATCH 07/34] update the function to return the median --- Sprint-1/fix/median.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index e0dd49425..b2b512837 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -27,8 +27,7 @@ function calculateMedian(list) { } // sorting the numeric data in ascending order numericValue.sort((a,b)=>a-b); - const middleIndex = Math.floor(list.length / 2); - const median = list[middleIndex]; + const median = Math.floor(numericValue.length / 2); return median; } From 01b6d848c785e8aba3c04af15b4d04d617633480 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 14:43:11 +0100 Subject: [PATCH 08/34] add logic to handle when data length is an odd number --- Sprint-1/fix/median.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index b2b512837..cbe6d407d 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -29,6 +29,9 @@ function calculateMedian(list) { numericValue.sort((a,b)=>a-b); const median = Math.floor(numericValue.length / 2); return median; + //Add statement to handle when array length is an odd number + if (numericValue.length % 2 !==0) + return numericValue[median] } module.exports = calculateMedian; From 33f695284b179b065cb1ec16c356a1dfb0403e7b Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 14:44:58 +0100 Subject: [PATCH 09/34] refactor the code --- Sprint-1/fix/median.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index cbe6d407d..85e20e750 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -28,10 +28,11 @@ function calculateMedian(list) { // sorting the numeric data in ascending order numericValue.sort((a,b)=>a-b); const median = Math.floor(numericValue.length / 2); - return median; + //Add statement to handle when array length is an odd number - if (numericValue.length % 2 !==0) + if (numericValue.length % 2 !==0){ return numericValue[median] + } } module.exports = calculateMedian; From 4f2de61cb52b4585ccd54fac286cfb91cac8d4bf Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 14:51:16 +0100 Subject: [PATCH 10/34] add statement to handle when the data length is even number --- Sprint-1/fix/median.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sprint-1/fix/median.js b/Sprint-1/fix/median.js index 85e20e750..bed111348 100644 --- a/Sprint-1/fix/median.js +++ b/Sprint-1/fix/median.js @@ -31,7 +31,11 @@ function calculateMedian(list) { //Add statement to handle when array length is an odd number if (numericValue.length % 2 !==0){ - return numericValue[median] + return numericValue[median]; + } + // add a logic to handle when the data length is even number + if (numericValue.length % 2 === 0){ + return (numericValue[median-1] + numericValue[median])/2 } } From 452383ba0f8e12cd5c41d69efe2c3763e82e2b39 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 16:40:14 +0100 Subject: [PATCH 11/34] Wrote a test case to return an empty array --- Sprint-1/implement/dedupe.test.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Sprint-1/implement/dedupe.test.js b/Sprint-1/implement/dedupe.test.js index d7c8e3d8e..27c123130 100644 --- a/Sprint-1/implement/dedupe.test.js +++ b/Sprint-1/implement/dedupe.test.js @@ -16,12 +16,21 @@ E.g. dedupe([1, 2, 1]) returns [1, 2] // Given an empty array // When passed to the dedupe function // Then it should return an empty array -test.todo("given an empty array, it returns an empty array"); +//test.todo("given an empty array, it returns an empty array"); +const dedupe = require("./dedupe.js"); + +describe("dedupe given an empty array, it returns an empty array ", () => { + [{ input: [], expected: [] }].forEach(({ input, expected }) => + it(`returns the empty array for [${input}]`, () => + expect(dedupe(input)).toEqual(expected)) + ); +}); // Given an array with no duplicates // When passed to the dedupe function // Then it should return a copy of the original array + // Given an array of strings or numbers // When passed to the dedupe function // Then it should return a new array with duplicates removed while preserving the From 7a97ecdc043a7ce65573f876e9d5e6b1979cfd85 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 16:42:47 +0100 Subject: [PATCH 12/34] implement a function to pass the test that returns empty array --- Sprint-1/implement/dedupe.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sprint-1/implement/dedupe.js b/Sprint-1/implement/dedupe.js index 781e8718a..88e1da751 100644 --- a/Sprint-1/implement/dedupe.js +++ b/Sprint-1/implement/dedupe.js @@ -1 +1,8 @@ -function dedupe() {} +function dedupe() { + const unique = [...new Set(n)]; + return unique; +} + + + +module.exports = dedupe; \ No newline at end of file From ab4fe3b0856d8a2de1a084a8c933fe7386733837 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 16:49:05 +0100 Subject: [PATCH 13/34] wrote a test that returns original copy of the arrays when there is no duplicate --- Sprint-1/implement/dedupe.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sprint-1/implement/dedupe.test.js b/Sprint-1/implement/dedupe.test.js index 27c123130..f5ceb9b23 100644 --- a/Sprint-1/implement/dedupe.test.js +++ b/Sprint-1/implement/dedupe.test.js @@ -30,6 +30,14 @@ describe("dedupe given an empty array, it returns an empty array ", () => { // When passed to the dedupe function // Then it should return a copy of the original array +describe("dedupe given an array with no duplicate, it returns a copy of original array ", () => { + [{ input: [1, 2, 3], expected: [1, 2, 3] }].forEach(({ input, expected }) => + it(`returns the original copy of the array for [${input}]`, () => + expect(dedupe(input)).toEqual(expected)) + ); +}); + + // Given an array of strings or numbers // When passed to the dedupe function From 0f7c2a1e478721af425156c08651aa881976d8e3 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 22 Jul 2026 17:19:17 +0100 Subject: [PATCH 14/34] wrote a test case that retuns no duplice of strings and numbers --- Sprint-1/implement/dedupe.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sprint-1/implement/dedupe.test.js b/Sprint-1/implement/dedupe.test.js index f5ceb9b23..d5a68ed2d 100644 --- a/Sprint-1/implement/dedupe.test.js +++ b/Sprint-1/implement/dedupe.test.js @@ -43,3 +43,16 @@ describe("dedupe given an array with no duplicate, it returns a copy of original // When passed to the dedupe function // Then it should return a new array with duplicates removed while preserving the // first occurrence of each element from the original array. + +describe("dedupe given an array of strings or Numbers , it returns a copy with duplicates in original array removed ", () => { + [ + { + input: ["s", "t", "r", "i", "n", "g", "s"], + expected: ["s", "t", "r", "i", "n", "g"], + }, + { input: [1, 1, 2, 3, 3, 4], expected: [1,2,3,4] }, + ].forEach(({ input, expected }) => + it(`returns the original copy of the array for [${input}]`, () => + expect(dedupe(input)).toEqual(expected)) + ); +}); \ No newline at end of file From 2377aa1038a79a11147183a83b6af01cc7717837 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 11:44:48 +0100 Subject: [PATCH 15/34] Wrote a test case to check when empty array is passed to the function that it returns -Infinity --- Sprint-1/implement/max.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-1/implement/max.test.js b/Sprint-1/implement/max.test.js index 82f18fd88..e832ef469 100644 --- a/Sprint-1/implement/max.test.js +++ b/Sprint-1/implement/max.test.js @@ -16,7 +16,9 @@ const findMax = require("./max.js"); // When passed to the max function // Then it should return -Infinity // Delete this test.todo and replace it with a test. -test.todo("given an empty array, returns -Infinity"); +test("case 1: Given an empty array when passed to a function should return -Infinity ", () => { + expect(findMax([])).toBe(-Infinity ); +}); // Given an array with one number // When passed to the max function From fd4d58829b36f8e79f26b6d5de3708c468b1e86c Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 11:46:25 +0100 Subject: [PATCH 16/34] Implements function to pass the test --- Sprint-1/implement/max.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-1/implement/max.js b/Sprint-1/implement/max.js index 6dd76378e..f13322881 100644 --- a/Sprint-1/implement/max.js +++ b/Sprint-1/implement/max.js @@ -1,4 +1,8 @@ function findMax(elements) { + + const maxiNum = Math.max(...elements); + return maxiNum; + } module.exports = findMax; From fea2db77f9aea4ddbc4d851747bdaeca14f08f8b Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 11:49:37 +0100 Subject: [PATCH 17/34] Wrote a test case to check for when an array has just one number that it returns that number --- Sprint-1/implement/max.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-1/implement/max.test.js b/Sprint-1/implement/max.test.js index e832ef469..eb45215d5 100644 --- a/Sprint-1/implement/max.test.js +++ b/Sprint-1/implement/max.test.js @@ -23,6 +23,9 @@ test("case 1: Given an empty array when passed to a function should return -Infi // Given an array with one number // When passed to the max function // Then it should return that number +test("case 2: Given an array with one number when passed to a function should return that number ", () => { + expect(findMax([6])).toBe(6); +}); // Given an array with both positive and negative numbers // When passed to the max function From 8d6212f021e0ff4aabfc9fee00d66f1ca93205c3 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 11:57:06 +0100 Subject: [PATCH 18/34] wrote a test case to check for when an array of both +ve and _ve number were passed that it reurns the largest numer overall --- Sprint-1/implement/max.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-1/implement/max.test.js b/Sprint-1/implement/max.test.js index eb45215d5..97cae6cbb 100644 --- a/Sprint-1/implement/max.test.js +++ b/Sprint-1/implement/max.test.js @@ -30,6 +30,9 @@ test("case 2: Given an array with one number when passed to a function should r // Given an array with both positive and negative numbers // When passed to the max function // Then it should return the largest number overall +test("case 3: Given an array with both positive and negative numbers when passed to a function should return the largest number overall ", () => { + expect(findMax([-1,-2,-6,6,8,10])).toBe(10); +}); // Given an array with just negative numbers // When passed to the max function From c8b1bf20e016a92f1abcf873bcf078e53eb1883a Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 12:01:34 +0100 Subject: [PATCH 19/34] Wrote a test case to check and return from an array of -ve numbers the one closest to zero --- Sprint-1/implement/max.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-1/implement/max.test.js b/Sprint-1/implement/max.test.js index 97cae6cbb..aabeaadeb 100644 --- a/Sprint-1/implement/max.test.js +++ b/Sprint-1/implement/max.test.js @@ -37,6 +37,9 @@ test("case 3: Given an array with both positive and negative numbers when passed // Given an array with just negative numbers // When passed to the max function // Then it should return the closest one to zero +test("case 3: Given an array with just negative numbers when passed to a function should return the closest number to zero", () => { + expect(findMax([-1, -2, -6, -10, -8, -12])).toBe(-1); +}); // Given an array with decimal numbers // When passed to the max function From 9a2a9146a4928862ae5669d99435544785cd3e6a Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 12:13:37 +0100 Subject: [PATCH 20/34] Wrote a test case 5 to check and return the largest decimal number from given array of decimal numbers --- Sprint-1/implement/max.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sprint-1/implement/max.test.js b/Sprint-1/implement/max.test.js index aabeaadeb..96dc64254 100644 --- a/Sprint-1/implement/max.test.js +++ b/Sprint-1/implement/max.test.js @@ -37,13 +37,16 @@ test("case 3: Given an array with both positive and negative numbers when passed // Given an array with just negative numbers // When passed to the max function // Then it should return the closest one to zero -test("case 3: Given an array with just negative numbers when passed to a function should return the closest number to zero", () => { +test("case 4: Given an array with just negative numbers when passed to a function should return the closest number to zero", () => { expect(findMax([-1, -2, -6, -10, -8, -12])).toBe(-1); }); // Given an array with decimal numbers // When passed to the max function // Then it should return the largest decimal number +test("case 5: Given an array with decimal numbers when passed to a function should return largest decimal number", () => { + expect(findMax([1.1, 0.2, 0.3, 0.4, 0.5, 0.6,2.75])).toBe(2.75); +}); // Given an array with non-number values // When passed to the max function From e6c2e454da67c588c3c5785ee15caf8d4f778dde Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 12:55:13 +0100 Subject: [PATCH 21/34] wrote a test case to check and return largest numeric value while ignoring non-numeric value when given an array of both numeric and non-numeric values --- Sprint-1/implement/max.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-1/implement/max.test.js b/Sprint-1/implement/max.test.js index 96dc64254..ed5b5d76f 100644 --- a/Sprint-1/implement/max.test.js +++ b/Sprint-1/implement/max.test.js @@ -51,6 +51,10 @@ test("case 5: Given an array with decimal numbers when passed to a function shou // Given an array with non-number values // When passed to the max function // Then it should return the max and ignore non-numeric values +test("case 6: Given an array with numeric and non-numeric values it returns the max and ignores non-numeric values", () => { + expect(findMax([1.1, 3, 4, "Toby", "undefine", "", 2.75])).toBe(4); +}); + // Given an array with only non-number values // When passed to the max function From 9681bc630ec7b09e265f0a55b5b00da4ab90e1b6 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 12:57:45 +0100 Subject: [PATCH 22/34] implement the findMax function to filter non-numeric data --- Sprint-1/implement/max.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sprint-1/implement/max.js b/Sprint-1/implement/max.js index f13322881..dd19f0ebd 100644 --- a/Sprint-1/implement/max.js +++ b/Sprint-1/implement/max.js @@ -1,7 +1,11 @@ function findMax(elements) { + // filter out the numeric numbers +const numbers = elements.filter( + (item) => typeof item === "number" && !Number.isNaN(item) +); - const maxiNum = Math.max(...elements); - return maxiNum; +const maxiNum = Math.max(...numbers); +return maxiNum; } From 91f9d57a789581d8595ef7573a32c57a4710ea87 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 13:26:39 +0100 Subject: [PATCH 23/34] wrote a test to check for when an array has only non-number value that it returns the least surprising value which is -Infinity --- Sprint-1/implement/max.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-1/implement/max.test.js b/Sprint-1/implement/max.test.js index ed5b5d76f..185523f13 100644 --- a/Sprint-1/implement/max.test.js +++ b/Sprint-1/implement/max.test.js @@ -59,3 +59,6 @@ test("case 6: Given an array with numeric and non-numeric values it returns the // Given an array with only non-number values // When passed to the max function // Then it should return the least surprising value given how it behaves for all other inputs +test("Given an array with only non-number values, it returns -Infinity", () => { + expect(findMax(["Toby", "Sam", null, undefined, ""])).toBe(-Infinity); +}); \ No newline at end of file From b8a5335e393d66e58e1cd6cfbdc3eebbbb38f185 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 13:45:54 +0100 Subject: [PATCH 24/34] Wrote a test case to return zero when the sum function is given an empty array --- Sprint-1/implement/sum.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sprint-1/implement/sum.test.js b/Sprint-1/implement/sum.test.js index dd0a090ca..321a931d1 100644 --- a/Sprint-1/implement/sum.test.js +++ b/Sprint-1/implement/sum.test.js @@ -13,7 +13,10 @@ const sum = require("./sum.js"); // Given an empty array // When passed to the sum function // Then it should return 0 -test.todo("given an empty array, returns 0") +test("given an empty array,when passed to the sun function it returns 0",()=> + {expect(sum([])).toBe(0); + +}); // Given an array with just one number // When passed to the sum function From 4243161f3a2e50411c3d590395c265fd184671d4 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 13:59:40 +0100 Subject: [PATCH 25/34] Implements a function to pass the test and returns zero when and empty array is passed to the function --- Sprint-1/implement/sum.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-1/implement/sum.js b/Sprint-1/implement/sum.js index 9062aafe3..594b5d2f0 100644 --- a/Sprint-1/implement/sum.js +++ b/Sprint-1/implement/sum.js @@ -1,4 +1,6 @@ function sum(elements) { + const addNum = elements.reduce((item, n) => item + n, 0); + return addNum; } module.exports = sum; From eca0d9b3086b30b81034fa54e1bc648cfa00b07f Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 14:02:48 +0100 Subject: [PATCH 26/34] Wrote a test case to return the same number when an array of just one number is passd into the function --- Sprint-1/implement/sum.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-1/implement/sum.test.js b/Sprint-1/implement/sum.test.js index 321a931d1..5c966335d 100644 --- a/Sprint-1/implement/sum.test.js +++ b/Sprint-1/implement/sum.test.js @@ -21,6 +21,9 @@ test("given an empty array,when passed to the sun function it returns 0",()=> // Given an array with just one number // When passed to the sum function // Then it should return that number +test("Test case 2: given an array with just one number ,when passed to the sun function it returns that number", () => { + expect(sum([5])).toBe(5); +}); // Given an array containing negative numbers // When passed to the sum function From 22b39c4333dc7bf3c5eccc969962fcfff3a64ceb Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 14:26:02 +0100 Subject: [PATCH 27/34] Wrote a test Case to return the same number when an array of one number is passed into a sum fn --- Sprint-1/implement/sum.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-1/implement/sum.test.js b/Sprint-1/implement/sum.test.js index 5c966335d..1d50bb321 100644 --- a/Sprint-1/implement/sum.test.js +++ b/Sprint-1/implement/sum.test.js @@ -29,6 +29,7 @@ test("Test case 2: given an array with just one number ,when passed to the sun f // When passed to the sum function // Then it should still return the correct total sum + // Given an array with decimal/float numbers // When passed to the sum function // Then it should return the correct total sum From 11549dea02480ff1f4955626619a4ece783cd435 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 14:31:57 +0100 Subject: [PATCH 28/34] Wrote a test case to return the correct total when an array of negative numbers are passed into the sum fn --- Sprint-1/implement/sum.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-1/implement/sum.test.js b/Sprint-1/implement/sum.test.js index 1d50bb321..4fdd73fbf 100644 --- a/Sprint-1/implement/sum.test.js +++ b/Sprint-1/implement/sum.test.js @@ -28,7 +28,9 @@ test("Test case 2: given an array with just one number ,when passed to the sun f // Given an array containing negative numbers // When passed to the sum function // Then it should still return the correct total sum - +test("Test case 3: given an array containing negative number ,when passed to the sun function it returns the correct total sum ", () => { + expect(sum([-5,-3,-8])).toBe(-16); +}); // Given an array with decimal/float numbers // When passed to the sum function From deec2857d0720ca8e6cfb61c7b10e93583c47182 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 15:15:44 +0100 Subject: [PATCH 29/34] Wrote a test case to return correct sum when decimal/float numbers both positive and negative are passed to the sum function --- Sprint-1/implement/sum.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sprint-1/implement/sum.test.js b/Sprint-1/implement/sum.test.js index 4fdd73fbf..834d57b03 100644 --- a/Sprint-1/implement/sum.test.js +++ b/Sprint-1/implement/sum.test.js @@ -35,6 +35,17 @@ test("Test case 3: given an array containing negative number ,when passed to the // Given an array with decimal/float numbers // When passed to the sum function // Then it should return the correct total sum +describe("Test case 3: given an array containing decimal/float numbers ,when passed to the sun function it returns the correct total sum ", () => { + [ + { input: [1.1, 2.2, 3.3], expected: 6.6 }, + { input: [-1.1, -2.2, -3.3], expected: -6.6 }, + ].forEach(({ input, expected }) => it(`returns the correct total sum for [${input}]`,()=>{ + expect(sum(input)).toBeCloseTo(expected); + + })); + +}); + // Given an array containing non-number values // When passed to the sum function From 64af99072297c4908f3198d00ec0024c221f9492 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 15:20:06 +0100 Subject: [PATCH 30/34] add .toFixed method and Number method to handle floating point numebers --- Sprint-1/implement/sum.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/implement/sum.js b/Sprint-1/implement/sum.js index 594b5d2f0..26e69cd7f 100644 --- a/Sprint-1/implement/sum.js +++ b/Sprint-1/implement/sum.js @@ -1,6 +1,6 @@ function sum(elements) { const addNum = elements.reduce((item, n) => item + n, 0); - return addNum; + return Number(addNum.toFixed(10)); } module.exports = sum; From 42d16061c2bcb727de8dd558b91ace360d8fdd69 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 16:19:45 +0100 Subject: [PATCH 31/34] Wrote a test to check for and return the sum of numerical value and ignore the non-numerical values when give array of both numeric and non-numeric values --- Sprint-1/implement/sum.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sprint-1/implement/sum.test.js b/Sprint-1/implement/sum.test.js index 834d57b03..b29b8522a 100644 --- a/Sprint-1/implement/sum.test.js +++ b/Sprint-1/implement/sum.test.js @@ -35,7 +35,7 @@ test("Test case 3: given an array containing negative number ,when passed to the // Given an array with decimal/float numbers // When passed to the sum function // Then it should return the correct total sum -describe("Test case 3: given an array containing decimal/float numbers ,when passed to the sun function it returns the correct total sum ", () => { +describe("Test case 4: given an array containing decimal/float numbers ,when passed to the sun function it returns the correct total sum ", () => { [ { input: [1.1, 2.2, 3.3], expected: 6.6 }, { input: [-1.1, -2.2, -3.3], expected: -6.6 }, @@ -51,6 +51,10 @@ describe("Test case 3: given an array containing decimal/float numbers ,when pas // When passed to the sum function // Then it should ignore the non-numerical values and return the sum of the numerical elements +test("Test case 5: given an array containing both numeric and non-numeric values ,when passed to the sun function it returns the sum of the numeric elements and ignore the non-numerical value ", () => { + expect(sum(["Toby", 6, "undefine","NaN",10, 11])).toBe(27); +}); + // Given an array with only non-number values // When passed to the sum function // Then it should return the least surprising value given how it behaves for all other inputs From c2dd7bacc022fab3a31263979728860988cd59dd Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 16:22:14 +0100 Subject: [PATCH 32/34] updated the function Implementation to pass the test of when non- numerical value and numerical values as pass as array into the fn --- Sprint-1/implement/sum.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-1/implement/sum.js b/Sprint-1/implement/sum.js index 26e69cd7f..578f93304 100644 --- a/Sprint-1/implement/sum.js +++ b/Sprint-1/implement/sum.js @@ -1,6 +1,8 @@ function sum(elements) { - const addNum = elements.reduce((item, n) => item + n, 0); + const onlyNumbers = elements.filter(elem=>typeof elem==="number"&&!Number.isNaN(elem)); + const addNum = onlyNumbers.reduce((item,n)=>item +n,0); return Number(addNum.toFixed(10)); } + module.exports = sum; From 2e66800f8e3e5406de171299f45163c9b2f8f577 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 16:26:56 +0100 Subject: [PATCH 33/34] Wrote test to check and return the least surprising value when an array of non-number values are given --- Sprint-1/implement/sum.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-1/implement/sum.test.js b/Sprint-1/implement/sum.test.js index b29b8522a..d381d662f 100644 --- a/Sprint-1/implement/sum.test.js +++ b/Sprint-1/implement/sum.test.js @@ -58,3 +58,6 @@ test("Test case 5: given an array containing both numeric and non-numeric value // Given an array with only non-number values // When passed to the sum function // Then it should return the least surprising value given how it behaves for all other inputs +test("given an array with only non-number values,when passed to the sun function it returns 0 which is the least surprising value given how it behaves for all other inputs", () => { + expect(sum(["Toby", "undefine", "NaN"])).toBe(0); +}); \ No newline at end of file From 4d15a8d1b66942bdf1d2657cbca46c5bbcd2bc71 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 23 Jul 2026 16:53:47 +0100 Subject: [PATCH 34/34] Refactored the Implementing function includes to still check the test accordingly --- Sprint-1/refactor/includes.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sprint-1/refactor/includes.js b/Sprint-1/refactor/includes.js index 29dad81f0..963ca00fd 100644 --- a/Sprint-1/refactor/includes.js +++ b/Sprint-1/refactor/includes.js @@ -1,12 +1,12 @@ // Refactor the implementation of includes to use a for...of loop -function includes(list, target) { - for (let index = 0; index < list.length; index++) { - const element = list[index]; - if (element === target) { +function includes(array, target) { + for (let i = 0; i < array.length; i++) { + if (array[i] === target) { return true; } } + return false; }