String.prototype._reverse = function () { let str = this, res = [] for (let i = 0; i <= this.length; i++) { res[i] = this[this.length - i] } return res.join('') } console.log('asc'._reverse());