Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursion task boilerplate missing arguments #23

Closed
robertpenner opened this issue Oct 21, 2013 · 4 comments
Closed

Recursion task boilerplate missing arguments #23

robertpenner opened this issue Oct 21, 2013 · 4 comments

Comments

@robertpenner
Copy link

Current boilerplate:

function getDependencies() {
// SOLUTION GOES HERE
}

Learners may take this literally and think they aren't supposed to use arguments in the function.

@timoxley
Copy link
Owner

Yep, I was trying to avoid encouraging the 'additional parameter' recursion style over a different style (e.g. collecting results in a closure var + helper function). Maybe needs some additional comment.

@robertpenner
Copy link
Author

But your solution has two arguments, so...?

@robertpenner
Copy link
Author

In any case, the function needs at least one argument.

@timoxley
Copy link
Owner

Sure, but the second argument is not actually something that's passed to the function, it's just an implementation detail of the recursive step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants