Javascript String isRotationOf(str)

Description

Javascript String isRotationOf(str)




String.prototype.isRotationOf = function(str) {
    return str.concat(str).indexOf(this) >= 0 && str.length === this.length;
}



PreviousNext

Related