String.prototype.palindrome = function (type){
const _arr = this.split('')
if (type === 'odd') {
return this + _arr.reverse().slice(1, _arr.length).join('')
}
return this + _arr.reverse().join('')
}
String.prototype.palindrome = function (type){
const _arr = this.split('')
if (type === 'odd') {
return this + _arr.reverse().slice(1, _arr.length).join('')
}
return this + _arr.reverse().join('')
}
本文标题:palindrome
本文链接:https://www.haomeiwen.com/subject/zuvelttx.html
网友评论