What’s the difference between 6054756961 and 5555555555? They both have ten digits.
And according to regex101.com-1 (757) 622-7382 doesn’t pass the test. The only one that should not pass the test (I still don’t get why) and does is 6054756961. However, in FCC a lot of numbers that don’t pass in regex101 pass.
The ones that are at the bottom don’t fully pass (except for 6054756961, that I don’t know why it shouldn’t pass). Yet in FCC they return true, and in regex101 they don’t since they are not a full match.
if the test method find a substring that match the pattern will return true
like if you do /a/.test("bcad") it will return true because the string contains an a, as long as there is even a single character matched, the test method returns true
if the string stay completely not highlighted then it returns false