From f31761e476f295b3459925b9c13b6e280e84e286 Mon Sep 17 00:00:00 2001 From: John Redden Date: Thu, 3 Dec 2020 20:03:58 -0500 Subject: [PATCH] Solved Challenge --- index.html | 6 ++++++ script.js | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 index.html create mode 100644 script.js diff --git a/index.html b/index.html new file mode 100644 index 0000000..9e7e942 --- /dev/null +++ b/index.html @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..fefc5e0 --- /dev/null +++ b/script.js @@ -0,0 +1,10 @@ +function reverseString(str) { + str = String(str); + let original = Array.from(str); + let opposite = []; + for(let i = 0; i < original.length; i++) { + opposite.unshift(original[i]); + } + opposite = opposite.join('').trim(); + return opposite; +} \ No newline at end of file