omit anonymous function that won't compile#11583
Merged
Conversation
add comment to make reader aware of anonymous function
Contributor
Preview URLsFlawsURL:
External URLsURL: No new external URLs (this comment was updated 2022-01-03 22:44:58.168586) |
wbamberg
reviewed
Jan 3, 2022
files/en-us/web/javascript/a_re-introduction_to_javascript/index.md
Outdated
Show resolved
Hide resolved
wbamberg
approved these changes
Jan 3, 2022
Collaborator
wbamberg
left a comment
There was a problem hiding this comment.
👍 thank you @LayersOfAbstraction !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Omitted function that would not compile and added comment to make readers aware of anonymous function that was assigned to the variable.
Motivation
My change is less likely to confuse readers as many of them including me would be testing your code and find that this one does not compile. That is the reason for the omission.
Supporting details
This doc here in W3Schools already shows these types of functions work and if you insert your example in their compiler [it won't compile.] (https://www.w3schools.com/js/js_function_definition.asp#:~:text=the%20function%20above%20is%20actually%20an%20anonymous%20function%20(a%20function%20without%20a%20name).)
Related issues
None.
Metadata