Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    CamperBot
    @camperbot

    :fire:Bonfire: Check for Palindromes :link:

    function palindrome(str) {
      // Good luck!
      return true;
    }
    
    
    
    palindrome("eye");

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

    more info:  bf details | bf links | hint

    Richard Cox
    @RickCoxDev
    hint
    CamperBot
    @camperbot

    hint [1/8]

    ## :construction: After this are possible spoiler hints.

    Make sure you've tried to hard to solve it yourself before proceeding. :construction:

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Richard Cox
    @RickCoxDev
    hint
    CamperBot
    @camperbot

    hint [2/8]

    Explanation:

    You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Richard Cox
    @RickCoxDev
    hint
    CamperBot
    @camperbot

    hint [3/8]

    Hint: 1

    You may use regular expressions (RegExp) to remove unwanted characters from the string.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Richard Cox
    @RickCoxDev
    hint
    CamperBot
    @camperbot

    hint [4/8]

    Hint: 2

    You may use Array.prototype.split and Array.prototype.join methods or for loop.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Richard Cox
    @RickCoxDev
    hint
    CamperBot
    @camperbot

    hint [5/8]

    Hint: 3

    You may lowercase the string using String.prototype.toLowerCase.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Richard Cox
    @RickCoxDev
    hint
    CamperBot
    @camperbot

    hint [6/8]

    Spoiler Alert!

    687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif

    Solution ahead!

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Abhisek Pattnaik
    @abhisekp
    @Stackclash what's the issue?
    Richard Cox
    @RickCoxDev
    I'm having trouble writing a regular expression that equals any whitespace or punctuation.
    Abhisek Pattnaik
    @abhisekp
    bf links
    CamperBot
    @camperbot
    Richard Cox
    @RickCoxDev
    I can get it to equal the first punctuation or whitespace but not any others in the string
    Abhisek Pattnaik
    @abhisekp
    bf palindrome
    CamperBot
    @camperbot

    :fire:Bonfire: Check for Palindromes :link:

    function palindrome(str) {
      // Good luck!
      return true;
    }
    
    
    
    palindrome("eye");

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

    more info:  bf details | bf links | hint

    Abhisek Pattnaik
    @abhisekp
    bf links
    CamperBot
    @camperbot
    Abhisek Pattnaik
    @abhisekp
    @Stackclash Did you read the docs?
    Richard Cox
    @RickCoxDev
    yeah I did. I understand what I need to do but I don't think I'm understanding exactly how a match is found in regular expressions.
    what I have now as my regular expression is /\W|\s|_/
    My thinking is "match any character that is not a word character OR match a whitespace OR match any underscore"
    Abhisek Pattnaik
    @abhisekp
    @Stackclash if you don't mention me, how will i know? :(

    @Stackclash The \W matches any non-alphanumeric (and also non-underscore character).

    Edit your thinking

    "match any character that is non-alphanumeric (and underscore) character" also "matches whitespace character". So you don't have to write \s.

    But you need to match the underscore character, so include the underscore.
    Hence, the regex becomes /\W|_/g

    Richard Cox
    @RickCoxDev
    sorry new to gitter.
    @abhisekp that worked. I needed to use global as well.
    thanks @abhisekp
    CamperBot
    @camperbot
    stackclash sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
    :star: 565 | @abhisekp | http://www.freecodecamp.com/abhisekp
    Veronica
    @sayaveronica
    hint
    CamperBot
    @camperbot

    hint [1/8]

    ## :construction: After this are possible spoiler hints.

    Make sure you've tried to hard to solve it yourself before proceeding. :construction:

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Veronica
    @sayaveronica
    hint
    CamperBot
    @camperbot

    hint [2/8]

    Explanation:

    You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Veronica
    @sayaveronica
    hint
    CamperBot
    @camperbot

    hint [3/8]

    Hint: 1

    You may use regular expressions (RegExp) to remove unwanted characters from the string.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Saicharan N
    @saicharannivarthi
    hint
    CamperBot
    @camperbot

    hint [1/8]

    ## :construction: After this are possible spoiler hints.

    Make sure you've tried to hard to solve it yourself before proceeding. :construction:

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Saicharan N
    @saicharannivarthi
    hint
    CamperBot
    @camperbot

    hint [2/8]

    Explanation:

    You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Saicharan N
    @saicharannivarthi
    hint
    CamperBot
    @camperbot

    hint [3/8]

    Hint: 1

    You may use regular expressions (RegExp) to remove unwanted characters from the string.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Ali-Haider5
    @Ali-Haider5
    hint
    CamperBot
    @camperbot

    hint [1/8]

    ## :construction: After this are possible spoiler hints.

    Make sure you've tried to hard to solve it yourself before proceeding. :construction:

    type hint for next hint :pencil: [Contribute at the FCC Wiki]

    Ali-Haider5
    @Ali-Haider5
    hint
    CamperBot
    @camperbot

    hint [2/8]

    Explanation:

    You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

    type hint for next hint :pencil: [Contribute at the FCC Wiki]