From dc35d7c2967c3459233a293d1968879bdb3f66aa Mon Sep 17 00:00:00 2001 From: Valery Malyshev Date: Fri, 21 Jun 2024 01:23:53 +0300 Subject: [PATCH] Swap Values --- 8_kyu/Swap Values/README.md | 7 +++++++ 8_kyu/Swap Values/index.test.ts | 5 +++++ 8_kyu/Swap Values/index.ts | 3 +++ README.md | 4 ++-- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 8_kyu/Swap Values/README.md create mode 100644 8_kyu/Swap Values/index.test.ts create mode 100644 8_kyu/Swap Values/index.ts diff --git a/8_kyu/Swap Values/README.md b/8_kyu/Swap Values/README.md new file mode 100644 index 0000000..6771a49 --- /dev/null +++ b/8_kyu/Swap Values/README.md @@ -0,0 +1,7 @@ +## Swap Values + +https://www.codewars.com/kata/5388f0e00b24c5635e000fc6 + +I would like to be able to pass an array with two elements to my swapValues function to swap the values. However it appears that the values aren't changing. + +Can you figure out what's wrong here? diff --git a/8_kyu/Swap Values/index.test.ts b/8_kyu/Swap Values/index.test.ts new file mode 100644 index 0000000..127abd1 --- /dev/null +++ b/8_kyu/Swap Values/index.test.ts @@ -0,0 +1,5 @@ +describe("Tests", () => { + it("example", () => { + expect(true).toBe(true); + }); +}); diff --git a/8_kyu/Swap Values/index.ts b/8_kyu/Swap Values/index.ts new file mode 100644 index 0000000..7fca469 --- /dev/null +++ b/8_kyu/Swap Values/index.ts @@ -0,0 +1,3 @@ +export function swapValues() { + return arguments[0].reverse(); +} diff --git a/README.md b/README.md index 2588ce0..4c8b38d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ ### Katas solved -`Total`: 118 \ -`8_kyu`: 93 \ +`Total`: 119 \ +`8_kyu`: 94 \ `7_kyu`: 16 \ `6_kyu`: 9 \ `5_kyu`: 0 \