reverseString.js

This commit is contained in:
Carlos Leon, Jr 2019-11-19 11:52:57 -08:00
parent 902914250e
commit 57425a290f
1 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,14 @@
const reverseString = function() { const reverseString = function(reverseString) {
var phrase = reverseString.split("");
var backward = phrase.reverse();
var taskComplete = backward.join("");
return taskComplete;
} }
reverseString('hello');
reverseString('hello there');
reverseString('123! abc!');
module.exports = reverseString module.exports = reverseString