Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite0448e4

Browse files
authored
Better explanation of scoped functions and variables.
1 parenta3d690a commite0448e4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,14 @@ me().on("click", async event => {
368368
*`f`,`fn` = function
369369
370370
#### Scope functions and variables inside`<script>`
371-
* ⭐ Use a block
372-
*`{let scoped=1;functionhey(text) {alert(text) };me().on('click',ev=> {hey("hi") }) }`
373-
*`let` is scoped in`{ }` blocks!
371+
* ⭐ Use a block`{let note="hi";functionhey(text) {alert(text) };me().on('click',ev=> {hey(note) }) }`
372+
*`let` and`function` is scoped within `{ }`
374373
* ⭐ Use `me()`
375374
* `me().hey = (text) => {alert(text) }`
376375
*`me().on('click', (ev)=> {me(ev).hey("hi") })`
377-
* ⭐ Use an event
378-
*`me().on('click',ev=> {/* add and call function here*/ })`
376+
* ⭐ Use an event`me().on('click',ev=> {/* add and call function here*/ })`
379377
* Use an inline module:`<script type="module">`
380-
*Warning: When using a module`me()`can no longersee`parentElement`, this means explicit selectors are required:`me(".mybutton")`
378+
*Note:`me()`in modules will notsee`parentElement`, explicit selectors are required:`me(".mybutton")`
381379
382380
#### Select a void element like`<input type="text"/>`
383381
* Use:`me('-')` or`me('prev')` or`me('previous')`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp