odin-javascript-exercises/03_reverseString/reverseString.js
2023-06-19 15:33:46 -07:00

12 lines
224 B
JavaScript

const reverseString = function (string) {
let reversed = ''
Array.from(string).reverse().forEach(char => {
reversed += char
})
return reversed
};
// Do not edit below this line
module.exports = reverseString;