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

named functions incorrect syntax? #47

Open
raganwald opened this issue Oct 26, 2013 · 0 comments
Open

named functions incorrect syntax? #47

raganwald opened this issue Oct 26, 2013 · 0 comments

Comments

@raganwald
Copy link
Owner

in https://leanpub.com/javascript-allonge/read#leanpub-auto-limits

limits

Named function expressions have limits. Here’s one such limit: You can do simple recursion, but not mutual recursion. For example:

var even = function (num) even { return (num === 0) || odd( num - 1) };
var odd  = function (num) odd  { return (num  >  0) && even(num - 1) };

shouldn't those functions be

var even = function even (num) { return (num === 0) || odd( num - 1) };
var odd  = function odd (num) { return (num  >  0) && even(num - 1) };
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

1 participant