QCM
Fonction
Une fonction en JavaScript :
Votre choixChoix attenduRéponse
Fonction Anonyme
Si on écrit const maFonction = function(a,b){return a+b;}
, alors :
Votre choixChoix attenduRéponse
Paramètres
Lorsqu’une fonction a un paramètre optionnel :
Votre choixChoix attenduRéponse
Portée
Concernant la portée :
Votre choixChoix attenduRéponse
Portée
1
const a = 1;
2
function f(){
3
const a = 2;
4
function g(){
5
const a = 3;
6
}
7
}
const a = 1; function f(){ const a = 2; function g(){ const a = 3; } }
Votre choixChoix attenduRéponse
Portée
Si une variable est déclarée avec let
dans un if
:
Votre choixChoix attenduRéponse
Portée
Si une variable est déclarée avec var
:
Votre choixChoix attenduRéponse
Portée
Si une variable est déclarée avec const
: