From 89d3845f1740c398052350ef6dccfc44e05bf710 Mon Sep 17 00:00:00 2001 From: hasinasunz <73208812+hasinasunz@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:02:28 -0500 Subject: [PATCH] worked --- index.html | 14 ++++++++++++++ rstring.js | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 index.html create mode 100644 rstring.js diff --git a/index.html b/index.html new file mode 100644 index 0000000..825ea0d --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + + + + + + Reverse String + + + + + + + \ No newline at end of file diff --git a/rstring.js b/rstring.js new file mode 100644 index 0000000..b0064e6 --- /dev/null +++ b/rstring.js @@ -0,0 +1,9 @@ +function reverseString(str) { + let rString = ""; + for (let i = str.length - 1; i >= 0; i--) { + rString += str[i]; +} + return rString; +}; + +console.log(reverseString("Hasina")); \ No newline at end of file