workshopper / workshopper/javascripting

Scope Problem is Confusing

Aperta
#125 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

discussion
Lingua principale
JavaScript
Stelle
2.9k
Fork
1k
Merge medio
14h 47m
PR unite (30g)
1

Descrizione

As someone who has no previous JavaScript knowledge, the Scope problem is quite frustrating. Even though the introduction does a good job defining scope, I was not prepared to follow the code example.

Comments need to be added next to console.log to indicate that when we pass the argument within bar back to the function, var b = 2 will be ignored. I'm sure I haven't phrased that well, but it's a starting point.

Also, what purpose does the line foo(); // 4, 2, 48 serve? I understand that foo is the function's name, and the comments next to it are the values of these variables, but this statement is just sitting there. We need context. What would including foo(); at the end of this program do when we run it?

I also don't believe the IIFE section adds any relevant information to this problem. It is distracting.

Now moving on to the challenge, I don't understand why there is )(); after every closing }. I suppose that ties back to the foo(); in the example code, but I don't understand its usage.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con l’introduzione al problema di Scope, l’esempio di codice, la sezione IIFE e la challenge citata nell’issue. Chiarisci cosa fa la chiamata a foo(), spiega il comportamento rilevante di console.log e la sintassi finale )(); e valuta se la sezione IIFE debba essere inclusa. Il lavoro è completato quando un principiante di JavaScript può seguire l’esempio e comprendere le istruzioni della challenge.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.