SOURCE

function ispalindromic (str){
    let newStr= str.split('').reverse().join('');
    if(newStr === str) {
        return true
    }
    else{
        return false;
    } 
}
let a ='cac'
console.log(ispalindromic(a))
console 命令行工具 X clear

                    
>
console