Introduction

A palindrome is a word, number, or phrase that can be read the same backwards and forwards. Some classical palindromes include "race car", "taco cat", and "Amor Roma" which are read the same backwards and forwards (ignoring both spaces and cases).

In this lab, you will develop a palindrome checker that decides whether a string is a palindrome or not.

Download the Lab

To get started, first download the ZIP file for Lab 6 here.

Completing the Lab

Part 1: Cleaning up the String

In lab6.js, we have provided an empty isPalindrome function that takes in one parameter, str, that should be tested to determine if it is a palindrome. If str is a palindrome, the function must return true; otherwise, it must return false.

In order to test if a string is a palindrome, we will first clean up the string by making the entire string lowercase. JavaScript provides a built-in function to help us with that:

At this point, your string has been cleaned so str is ready to be checked if it is a palindrome!

Let's do this! (Part 2)