DEV Community

[Comment from a deleted post]
Collapse
 
vaibhav63101425 profile image
Vaibhav

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.