odin-default-js-exercises/03_reverseString/reverseString.js

10 lines
266 B
JavaScript

const reverseString = function(str) {
let stringIntoArray = str.split("");
let arrayReverse = stringIntoArray.reverse();
let arrayIntoString = arrayReverse.join("");
return arrayIntoString;
};
reverseString('hello');
module.exports = reverseString;