// Sample solution
// Change this function so as to reverse strings.
// When given argument "Hello", it should return "olleH".
String.prototype.reverse = function(){
return this.split("").reverse().join("");
}
// test it:
str = "right to left";
console.log(str.reverse());
No comments:
Post a Comment