Js substring gets the specified length string of sample code from the right


As follows:

  

String.prototype.right = function (length_



        var _from = this.length - length_; 

        if (_from < 0) _from = 0

        return this.substring(this.length - length_, this.length); 

};