function pallindromeString(str){
let start=0, end=str.length -1;
while(start <= end){
if(str[start] === str[end])
continue;
return false;
}
return true;
}
console.log(pallindromeString('samasa'));
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter