Javascript String strReverse()

Description

Javascript String strReverse()


String.prototype.strReverse = function() {
  var length = this.length,
      strcopy = '';
  for(var i = length-1; i >= 0; i--) {
    strcopy+=this[i]// w w w. ja  v  a  2 s .  c  o m
  }
  return strcopy;
}

console.log("  0011".strReverse())



PreviousNext

Related