Skip to content

[Forms] Use regular JavaScript functions in the examples #19576

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

Merged
merged 1 commit into from
Feb 19, 2024
Merged

[Forms] Use regular JavaScript functions in the examples #19576

merged 1 commit into from
Feb 19, 2024

Conversation

jennevdmeer
Copy link
Contributor

There is no real point to use const for functions. While it surely is an opinion, the arrow syntax should only be used for anonymous functions and it seems more confusing for newer people.

  • To me and I would assume a new user function (...) { is instantly more clearer that we are working with a function instead of a variable
  • Function has no name during debugging when using arrow syntax
  • Its not shorter function foo(e) { vs const foo = (e) => {
  • Hoisting is weird, specially for newer people (https://stackoverflow.com/a/33040926)

I also changed the introduction line to the delete button part to detail what the user is going to do in following code block which seemed a little unclear to me personally. If the writing is not ok, please change it.

@javiereguiluz
Copy link
Member

Jenne, you explained it perfectly why this change is a good thing and I fully agree on that, so this is now merged.

While merging we did a very minor change (see 91c545f) because in the docs we never use "we", "our", etc. because the docs are written from the point of view of the reader, so we only use "you", "your", etc.

@jennevdmeer jennevdmeer deleted the patch-1 branch February 20, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants