Skip to content

omit anonymous function that won't compile#11583

Merged
wbamberg merged 2 commits intomdn:mainfrom
LayersOfAbstraction:anonymous_function_omission
Jan 3, 2022
Merged

omit anonymous function that won't compile#11583
wbamberg merged 2 commits intomdn:mainfrom
LayersOfAbstraction:anonymous_function_omission

Conversation

@LayersOfAbstraction
Copy link
Contributor

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

  • Rewrites (or significantly expands) a document

add comment to make reader aware of anonymous function
@LayersOfAbstraction LayersOfAbstraction requested a review from a team as a code owner December 30, 2021 05:16
@LayersOfAbstraction LayersOfAbstraction requested review from wbamberg and removed request for a team December 30, 2021 05:16
@github-actions github-actions bot added the Content:JS JavaScript docs label Dec 30, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2022

Preview URLs

Flaws

URL: /en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
Title: A re-introduction to JavaScript (JS tutorial)
on GitHub
Flaw count: 1

  • broken_links:
    • Can't resolve https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model

External URLs

URL: /en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
Title: A re-introduction to JavaScript (JS tutorial)
on GitHub

No new external URLs

(this comment was updated 2022-01-03 22:44:58.168586)

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thank you @LayersOfAbstraction !

@wbamberg wbamberg merged commit b460f85 into mdn:main Jan 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Content:JS JavaScript docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants