From d20246ac3c916d6e7309a7ea2959897c557f3908 Mon Sep 17 00:00:00 2001 From: Ellie V <32690589+misselliev@users.noreply.github.com> Date: Thu, 25 Oct 2018 11:19:52 -0700 Subject: [PATCH] Create Reverse each word of a string individually. --- Reverse each word of a string individually. #12 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Reverse each word of a string individually. #12 diff --git a/Reverse each word of a string individually. #12 b/Reverse each word of a string individually. #12 new file mode 100644 index 0000000..6c32184 --- /dev/null +++ b/Reverse each word of a string individually. #12 @@ -0,0 +1,8 @@ +function wordsReverser(string){ + var arr = string.split(""); + var output = []; + for(var i = arr.length - 1; i >= 0; i--){ + output.push(arr[i]); + } + return output.join(""); +}