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

removed misleading information about function declarations #113

Conversation

pedrocatre
Copy link
Contributor

Removed misleading comment information in the following examples:

var getData = function getData () {};
var getData = function getDataF () {};

In those examples the comments state that one of the benefits of those patterns is that they allow recursive functions. While that is true it is not a benefit of those examples over the others since all of the examples currently presented allow recursion.

The way the information is presented it implies that the pattern:

var getData = function () {};

does not allow recursive functions and that is not the case (this jsfiddle example might clarify that: http://jsfiddle.net/k6SSL/1/).

Furthermore one of the comments stated that one of the benefits of naming getDataF was that you can "Recurse by calling the name + 'F'". This suggests that we could not use recursion by calling getData() instead of getDataF() and we can (jsfiddle example: http://jsfiddle.net/4Pd9j/2/).

@chuanxshi chuanxshi merged commit 8b96a49 into chuanxshi:master Jun 10, 2018
@chuanxshi
Copy link
Owner

@pedrocatre thanks, merged!

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

Successfully merging this pull request may close these issues.

None yet

2 participants