- 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: let, const & var
This JavaScript quiz checks the three ways to declare a variable. You will predict output involving block scope, reassignment and redeclaration, and see why modern code uses const and let instead of var.
Domanda di esempio
Domanda 1 di 10What does this print?
let x = 1;
{
let x = 2;
}
console.log(x);
Mostra la risposta
B. 1 The inner let x is a new variable that only lives inside the braces. Outside the block, x is still the outer one, which holds 1.
Cosa copre questo quiz
- Block scope with
letandconst - Function scope with
var - Why
conststops reassignment but not changes to an object - Redeclaring a variable with
varvslet varvsletin aforloop
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.