UNPKG

ds-algo-study

Version:

Just experimenting with publishing a package

19 lines (12 loc) 627 B
/*********************************************************************** Write a function reverseStr(str) that accepts a string and returns that string reversed. Write this function using a fat arrow function! Examples: let result1 = reverseStr("hello"); // returns "olleh" let result2 = reverseStr("garden"); // returns "nedrag" let result3 = reverseStr("potato"); // returns "otatop" ***********************************************************************/ let reverseStr = (str) => str.split("").reverse().join(""); /**************DO NOT MODIFY ANYTHING UNDER THIS LINE*****************/ module.exports = reverseStr;