Where communities thrive


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

    hint [1/9]

    ## :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]

    onethreeeight
    @onethreeeight
    hint
    CamperBot
    @camperbot

    hint [2/9]

    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]

    Roko Medančić
    @R0k0
    hint profile lookup
    CamperBot
    @camperbot

    hint [1/9]

    ## :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]

    Roko Medančić
    @R0k0
    hint
    CamperBot
    @camperbot

    hint [2/9]

    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]

    codyWchamberlain
    @codyWchamberlain
    hint
    CamperBot
    @camperbot

    hint [3/9]

    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]

    codyWchamberlain
    @codyWchamberlain
    hint
    CamperBot
    @camperbot

    hint [4/9]

    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]

    codyWchamberlain
    @codyWchamberlain
    hint
    CamperBot
    @camperbot

    hint [5/9]

    Hint: 3

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

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

    codyWchamberlain
    @codyWchamberlain
    hint
    CamperBot
    @camperbot

    hint [6/9]

    Spoiler Alert!

    687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif

    Solution ahead!

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

    codyWchamberlain
    @codyWchamberlain
    hint
    CamperBot
    @camperbot

    hint [7/9]

    First

    function palindrome(str) {
      var normalizedStr = str.replace(/[\W_]/g, '').toLowerCase();
      var reverseStr = normalizedStr.split('').reverse().join('');
      return normalizedStr === reverseStr;
    }

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

    karenkomine
    @karenkomine
    Can someone explain the stuff that is inside .replace in var normalizedStr?
    karenkomine
    @karenkomine
    Why do we used ' ' ' /[\W_]/g ' ' ' ?
    /[\W_]/g
    In str.replace?
    karenkomine
    @karenkomine
    How would you set up your code so that in a for loop, you check every single word in an array and you stop the for loop when you find the longest string in that array?
    Ahmed Othman
    @ahmedgothman
    @karenkomine /[\W_]/g is for word characters similiar to [A-Za-z0-9]
    @karenkomine sorry i thought it was a recent comment:D
    Shruti Hardat
    @shrutihardat
    hint
    CamperBot
    @camperbot

    hint [1/9]

    ## :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]

    Shivang
    @shivang207
    hint Record Collection
    CamperBot
    @camperbot

    hint [1/9]

    ## :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]

    Kunal
    @kunalg1
    hint
    CamperBot
    @camperbot

    hint [2/9]

    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]

    Kunal
    @kunalg1
    hint
    CamperBot
    @camperbot

    hint [3/9]

    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]

    Kunal
    @kunalg1
    hint
    CamperBot
    @camperbot

    hint [4/9]

    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]

    Wilbert
    @moogler
    hint
    CamperBot
    @camperbot

    hint [1/12]

    ## :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]

    Wilbert
    @moogler
    hit=nt
    hint
    CamperBot
    @camperbot

    hint [2/12]

    Explanation:

    Our goal for solving this problem is tidying up the string passed in, and checking whether it is in fact a palindrome.

    • If you are unsure of what a palindrome is, it is a word or phrase that when reversed spells the same thing forwards or backwards. A simple example is mom, when you reverse the letters, it spells the same thing! Another example of a palindrome is race car. When we take out anything that is not a character it becomes racecar which is the same spelled forwards or backwards!

    Once we have determined whether it is a palindrome or not we want to return either true or false based on our findings.

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

    Wilbert
    @moogler
    hint
    CamperBot
    @camperbot

    hint [3/12]

    Hint: 1

    Regular expressions, RegEx, can be used to remove unwanted characters from the string.

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

    Wilbert
    @moogler
    hint12
    hint
    CamperBot
    @camperbot

    hint [4/12]

    Hint: 2

    The Array.prototype.split and Array.prototype.join methods can be of use here. For and while loops are another alternative, or why not even map!

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

    Wilbert
    @moogler
    hint
    CamperBot
    @camperbot

    hint [5/12]

    Hint: 3

    String.prototype.toLowerCase can be used to make a string lowercase.

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

    Wilbert
    @moogler
    hint
    CamperBot
    @camperbot

    hint [6/12]

    Spoiler Alert!

    687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif

    Solution ahead!

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

    Wilbert
    @moogler
    hint
    CamperBot
    @camperbot

    hint [7/12]

    First Solution

    function palindrome(str) {
      return str.replace(/[\W_]/g, '').toLowerCase() ===
             str.replace(/[\W_]/g, '').toLowerCase().split('').reverse().join('');
    }

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