Javascript String isReverseString()

Description

Javascript String isReverseString()



String.prototype.isReverseString = function() {
 for (var i = 0; i <= Math.floor(this.length / 2); i++)
  if (this[i] !== this[this.length - 1 - i]) return false
 return true/*from w w w  . java 2  s .c  om*/
};


debug('asadasa'.isReverseString())



PreviousNext

Related