Commit f084555
committed
minor #19576 [Forms] Use regular JavaScript functions in the examples (jennevdmeer)
This PR was submitted for the 7.0 branch but it was squashed and merged into the 6.4 branch instead.
Discussion
----------
[Forms] Use regular JavaScript functions in the examples
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.
Commits
-------
67eff99 [Forms] Use regular JavaScript functions in the examples1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
582 | | - | |
| 582 | + | |
| 583 | + | |
583 | 584 | | |
584 | 585 | | |
585 | 586 | | |
| |||
591 | 592 | | |
592 | 593 | | |
593 | 594 | | |
594 | | - | |
| 595 | + | |
595 | 596 | | |
596 | 597 | | |
597 | 598 | | |
| |||
602 | 603 | | |
603 | 604 | | |
604 | 605 | | |
605 | | - | |
| 606 | + | |
606 | 607 | | |
607 | 608 | | |
608 | 609 | | |
| |||
0 commit comments