Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Potential duplicate of Regex for a decimal number divisible by 4
checks for negative numbers
Enjoy your report
This comment has been deleted.
The kata there is a sentence:
"..It should find two different items in the array"
The point there is about finding different values in context of array (different indices of values, not values itself)
Description should be fixed to clarify it
The sentence "as a set of strings" has been added to the description. This is enough?
Approved
Python fork
This is covered by the following part of the description:
To expand:
patternMatch
is supposed to use[matchesSymbol]
on whatever it's given, and with its logic written that way you then need to define[matchesSymbol]
properties on built-in prototypes for it to behave correctly. Technically you could just defineObject.prototype[matchesSymbol]
, but it wouldn't be a very good way to do it.The test you mentioned does look incorrect to me, but I can't reproduce the issue or figure out how it might have happened.
I've re-validated my own solution a few times with no issues, so if you are getting a lot of randomised test failures it is probably an issue with your solution.
toString
isn't considered and isn't supposed to have an effect on anything, butvalueOf
matters and is hinted at by the description at one point.This should be covered by the primitive tests.
What this is saying is that there is no special handling for a non-existent property and it should be treated the same as if it existed but had an undefined value. Sometimes things behave differently based on that, i.e. in some cases, if we have the following code:
Some things will treat
objA
andobjB
differently, even thoughobjA.prop
andobjB.prop
are bothundefined
. We don't want any special handling here, so the patterns{ prop: undefined }
and{ prop: () => true }
should match bothobjA
andobjB
.Possibly the confusion here is because that test is checking for
[matchesSymbol]
onNumber
(a function) and notNumber.prototype
.As with Symbols, Sets are supposed to be compared with
===
. The__name
thing is used by the tests for display purposes, it isn't supposed to be accessed by the solution.Loading more items...