re: How to reverse a string in JavaScript VIEW POST

FULL DISCUSSION
 

String.prototype.reverse = function() {
var s = "";
var i = this.length;
while (i>0) {
s += this.substring(i-1,i);
i--;
}
return s;
}

we can use this also.

code of conduct - report abuse