Javascript String Reverse

Simple Javascript reverse function prototyped onto the String Object.

String.prototype.reverse = function(){
    return this.split("").reverse().join("");
}

Usage Example:

var test_string = "reverse this string";
var reversed_string = test_string.reverse();
// Javascript //

Comments & Questions

Add Your Comment