Skip to content

sadiejay/fcc-js-palindrome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Palindrome Checker

Table of contents

Overview

The challenge

Return true if the given string is a palindrome. Otherwise, return false.

Note: You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything into the same case (lower or upper case) in order to check for palindromes.

Links

My process

  • write pseudocode
  • figure out palindrome function
  • create regex to clean up input
  • call function inside other function

Built with

  • JS

What I learned

  • reverse() came in super handy.
    • If I hadn't come across that I probably would have created an array and created a loop to split the str, unshift each letter into new string, and then join.

code snippets

let regexFunction = (str) => {
    let textLowerCase = str.toLowerCase();
    let cleanStr = textLowerCase.replace(/[^a-z0-9]/gi, '');
    return cleanStr;
} 
  • I remembered to use the .toLowerCase() from my email generator

Continued development

  • I want to create a UI to display:
    • client side input
    • revesed input
    • is palindrome? true / false
  • Create my own tests from expected results given

Useful resources

Author

Acknowledgments

  • Class Cohorts fCC bootcamp cohort got me my start and now I'm finishing up!

About

Solution to fCC Palindrome Checker

Resources

Stars

Watchers

Forks