比较第一个与最后一个,第二个与倒数第二个... 比较次数为Math.floor(string.length / 2) const _isPalindrome = (string) => { // 补全代码 let res for (let index = 0; index < Math.floor(string.length / 2); ...