Solution: Reverse a String - Javascript - (Basic Algorithm Scripting - freeCodeCamp)

Reverse a String 

Reverse the provided string.

You may need to turn the string into an array before you can reverse it.

Your result must be a string.


SOLUTION:


function reverseString(str) {  
  return str.split("").reverse().join("");
}

reverseString("hello");
console.log(reverseString("hello"));

reverse a string - the dawnsoft


Click here to go to the original link of the question.


Post a Comment

Previous Post Next Post