我有以下内容:
function checkPalindrom(palindrom)
{
for( var i = palindrom.length; i > 0; i-- )
{
if( palindrom[i] = palindrom.charAt(palindrom.length)-1 )
{
document.write('the word is palindrome.');
}else{
document.write('the word is not palindrome!');
}
}
}
checkPalindrom('wordthatwillbechecked');
我的代码出了什么问题?我想检查这个词是否是回文。
蝴蝶不菲
明月笑刀无情
慕慕森
随时随地看视频慕课网APP
相关分类