as the name of the tests imply, your solution has to be reusable, i.e. invoke() should behave correctly when called several times on the same Lazy object
I believe one of the test cases might be wrong. Test Reuse lazy
filterNumbers + filterRange + max function, 2nd one.
My function passes every one except for this one, here are the results
for each stage:
[Function: filterNumbers] arguments - [ 1, '3', [ 2 ], {}, 4, 2, 1, 8,
6, [], '7', -1, { v: 5 }, 4 ] result - [ 1, 4, 2, 1, 8, 6, -1, 4 ],
[Function: filterRange] arguments - [ 1, 3, 1, 4, 2, 1, 4, 2, 1, 8, 6,
-1, 4 ] result [ 1, 2, 1, 2, 1 ],
[Function: max] arguments - [ 1, 2, 1, 2, 1, 2, 1 ] result 2
Everything seems correct but for some reason the expected output in the last one is 1,
not 2. Might there be a mistake here?
We're built different...
as the name of the tests imply, your solution has to be reusable, i.e.
invoke()
should behave correctly when called several times on the sameLazy
objectThis comment is hidden because it contains spoiler information about the solution
yeah, i believe i'm talking about the same one just above. noone cares
I believe one of the test cases might be wrong. Test Reuse lazy
filterNumbers + filterRange + max function, 2nd one.
My function passes every one except for this one, here are the results
for each stage:
[Function: filterNumbers] arguments - [ 1, '3', [ 2 ], {}, 4, 2, 1, 8,
6, [], '7', -1, { v: 5 }, 4 ] result - [ 1, 4, 2, 1, 8, 6, -1, 4 ],
[Function: filterRange] arguments - [ 1, 3, 1, 4, 2, 1, 4, 2, 1, 8, 6,
-1, 4 ] result [ 1, 2, 1, 2, 1 ],
[Function: max] arguments - [ 1, 2, 1, 2, 1, 2, 1 ] result 2
Everything seems correct but for some reason the expected output in the last one is 1,
not 2. Might there be a mistake here?