- Esecutori
-
Impara
Impara Python Esempi eseguibili, NumPy, pandas e altro Impara l'IA / Machine LearningReti neurali, ML e LLM da zero Impara C e C++ Puntatori, memoria, STL e C++ moderno Impara C#Fondamenti, OOP, LINQ, async ed esercizi .NET Impara MatplotlibGrafici a linee, barre, dispersione e torta con visualizzatori Impara RustOwnership, trait, gestione degli errori e thread Impara GoSlice, interfacce, goroutine e canali Algoritmi Python Ricerca, ordinamento, ricorsione e visualizzazioni O(n) Algoritmi C e C++ Confronta le implementazioni in C e C++ Programmazione per bambini Impara a programmare giocando!
- QuizNuovo
- SfideNuovo
- Per docentiNuovo
- Aggiornamenti
- Offrimi un caffè
Quiz di JavaScript: Getters, Setters & static
This JavaScript quiz focuses on accessors and static members. You will predict what getters return, what happens when you assign to a getter-only property, how static members are shared and inherited, and which getters JSON.stringify sees.
Domanda di esempio
Domanda 1 di 10Temp defines get fahrenheit() { ... }. How do you read the value for const t = new Temp(100)?
Mostra la risposta
C. t.fahrenheit A getter is read like a normal property, with no parentheses, and JavaScript calls the function for you. t.fahrenheit() would try to call the returned number, and Temp.fahrenheit looks on the class, not the instance.
Cosa copre questo quiz
- Reading a
getproperty without parentheses - Validating input in a
setaccessor - Getter-only properties in sloppy and strict mode
staticfields, methods andthisinside them- The infinite recursion trap in setters
Domande frequenti
Serve un account?
No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.
Posso rifarlo?
Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.