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.
I removed all tests where expected and actual values were switched. But there are still tests in the form
Yes, there are also test cases in the form
strictEqual(expected, next())
.The
No modify expected variable
test looks like this:Hint: you need to do something outside of the function
next
in order to pass this test. (The initial solution has this line:// Hint: Initial code
.)Please post your current solution in a comment with the spoiler flag.
How come?
I've been trying to solve it for one hour and still can't find the solution...
Do you have enough thumb down?
Yep, sorry for any lack of clarity. JS cannot replace an arbitrary function reference (e.g.
function (someFunc) { ... }
cannot "swap out"someFunc
, except as a locally-scoped binding). It can replace a variable or property name referring to a function (e.g.function(obj, methodName) { ... }
CAN substitute a new value intoobject[methodName]
). That latter can be used in a hacky way to replace top-level variables:replaceMethod(global, 'funcName')
could reassignglobal[funcName]
.