It works for me (I tested it by myself with various input and playing it) but not for the tests checker. I don’t even pass the second test lol. Any suggestion will be appreciated.
C O N S O L E
// running tests
2. If a small straight is rolled, your checkForStraights function should enable the fourth radio button, set the value to 30, and update the displayed text to , score = 30.
3. If a large straight is rolled, your checkForStraights function should enable the fifth radio button, set the value to 40, and update the displayed text to , score = 40.
4. If a large straight is rolled, your checkForStraights function should also enable the fourth radio button, set the value to 30, and update the displayed text to , score = 30.
// tests completed
you don’y need to do this, if you remove the anchors you can just check if the sequence of numbers is present. One thing to consider is if like there are two 2, or two 3… like 12234 this is a good combination, but your code doesn’t validate it
Now, let me see why the tests are rejecting this, if the reason is this one I found or not
Ok, you are testing a randomly ordered set of numbers:
If I call console.log(checkForStraights([3, 6, 3, 5, 4])), which contains a straight (3, 4, 5, 6), then arrToStr is 36354 which will not test true for any of the regexes