Documentation improvement: clarify function assignment behavior
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript
- Ambito
- documentation
Direzione di ricerca
Apri la sezione Function expressions all’indirizzo https://javascript.info/function-expressions e individua l’argomento “Function is a Value” e il relativo esempio di assegnazione. Rivedi la formulazione intorno a “copy a function” e chiarisci che viene assegnato il riferimento allo stesso oggetto funzione, mantenendo il comportamento dell’esempio. Il lavoro è concluso quando la spiegazione è inequivocabile per chi sta imparando e l’esempio rimane corretto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I was reading the Function expressions section and noticed a wording choice that confused me a little.
The section mentions that we can "copy a function to another variable". Maybe the intention is to show that functions are values in JavaScript, the wording initially made me think that a new function was being created.
issue in the section -> url -> https://javascript.info/function-expressions
topic is "Function is a Value"
the example code was ->
function sayHi() { // (1) create
alert( "Hello" );
}
let func = sayHi; // (2) copy
func(); // Hello // (3) run the copy (it works)!
sayHi(); // Hello // this still works too (why wouldn't it)
My understanding is that func receives a reference to the same function object rather than creating an independent copy of the function itself.
There maybe a chance that i have misunderstood it , the copy could mean the reference is copied and a little context about reference would help even if it is included in the previous section.
This is not a major issue, but I thought a small clarification might help readers who are learning about values and references.
Thank you so much for the documentation
- Lingua principale
- HTML
- Stelle
- 25.5k
- Fork
- 4k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di javascript-tutorial/en.javascript.info
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Keyboard events: keydown filtering example can't block IME-composed input (Korean/Japanese/Chinese) Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
javascript-tutorial/en.javascript.info#3978 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Tutte le issue di javascript-tutorial/en.javascript.info
Issue simili
-
user-reported
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Kong/developer.konghq.com#7316 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
HarperFast/skills#96 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
infinispan/infinispan#18150 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
fullcalendar/fullcalendar#8106 ·