- Comments at the end of the example:
var obj = Object.create(RandomizedCollection).createNew(). Looks like this isn't the case, as running the code with a testcase shows a constructor is needed, so it's a
new RandomizedCollection();that's performed
- Running the code expects specific items returned by
getRandom(): not sure if that's normal, I hope it isn't the case when submitting the code
- Submitting my code resulted in a Runtime Error even though running it with the same test case worked
- Test case values used when submitting the code looked wrong as there were a few inserts then many identical calls to
getRandom(), not sure if that's normal
So I wrote some code to work the example provided
obj = Object.create(RandomizedCollection).createNew(), which didn't run. Then I wrote it to work with a call to
new RandomizedCollection() and that one passed (except for the
getRandom() call, which was randomly right.
I'm not yet used to this website so I hope I'm not missing something obvious.