Node.js examples for String:Algorithm
Reverse a String - Enter a string and the program will reverse it and print it out.
String.prototype.reverse = function () { "use strict"; var i,/*from ww w. ja v a2 s . c om*/ r; for (i = this.length - 1, r = ''; i >= 0; r += this[i--]) {} return r; }; this.console.log("stringExample".reverse());