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'm all the way down to test 28. Where the function declared is var id = function (id) { return id; }
But when I print the given function I actually get function id(_id) { return _id; }
The argument passed into the defaultArguments is { id: 'test' }
My first question is: Is there a special meaning to parameters prefixed with _?
Second, when I work around this test by ignoring any _ prefix. The second test which calls the exact same function, and passes the exact same argument into defaultArguments expects the method not to return a default.
Is this a broken test or am I missing something?
My test output with some logging:
var id = function (id) { return id; }
function id(_id) {
return _id;
}
Args: { id: 'test' }
Test Passed: Value == test
function id(_id) {
return _id;
}
Args: { id: 'test' }
defaultArguments(id,{id:"test"})(undefined) - Expected: undefined, instead got: test