function isPalindrom(string) {
var palindrom = true;
for ( i = 0; i < (string.length / 2); i++ ) {
if ( string.charAt(i) != (string.charAt(string.length - i - 1)) ) {
palindrom = false;
break;
}
}
if ( palindrom ) {
console.log(string + ' is a palindrom');
} else {
console.log(string + ' is not a palindrom');
}
}
isPalindrom('radar');
isPalindrom('radars');