need help writing a code to test if a word is a palindrome?

I need to write the function "isPalindrome()" so that it loops through the word and tests whether the word reads the same forward and backward. A palindrome is a word that is the same forwards and backwards. The word I want to use is SAGAS. The language I am using to write the code is JavaScript and I would like it to be an if statement Here is what I have so far:

function isPalindrome(SAGAS)
{
var left = 0, right = phrase.length - 1;
var palindrome = true;

while (palindrome && left < right)
{

Topic archived. No new replies allowed.