Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, January 31, 2013

Codecademy: String Reversal - Part 3



// 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


This is an example of scrolling text using Javascript.

Popular Posts