What is the outcome of console.log(typeof x); if x is declared but not initialized in JavaScript?
A). a. Undefined
B). b. Null
C). c. Error
D). d. Object
What keyword is used to declare variables in JavaScript?
A). a. var
B). b. const
C). c. let
D). d. def
What keyword is used to declare variables in JavaScript?
A). a. var
B). b. const
C). c. let
D). d. def
What does hoisting refer to in JavaScript variable declarations?
A). a. Declaring a variable multiple times
B). b. Initializing a variable before declaring
C). c. Moving variable declarations to the top
D). d. Using undeclared variables
Which keyword is used to declare a variable that cannot be reassigned in JavaScript?
A). a. var
B). b. let
C). c. const
D). d. mutable
Which of the following statements is true about the let keyword in JavaScript?
A). a. Variables declared with let have global scope
B). b. Variables declared with let are block-scoped
C). c. let is used to declare constants
D). d. let is used to declare functions
What will happen if you try to reassign a value to a constant declared with const in JavaScript?
A). a. It will throw an error
B). b. It will silently ignore the assignment
C). c. It will convert the variable to let
D). d. It will convert the variable to var
What will happen if you try to reassign a value to a constant declared with const in JavaScript?
A). a. It will throw an error
B). b. It will silently ignore the assignment
C). c. It will convert the variable to let
D). d. It will convert the variable to var
What does hoisting refer to in JavaScript variable declarations?
A). a. Declaring a variable multiple times
B). b. Initializing a variable before declaring
C). c. Moving variable declarations to the top
D). d. Using undeclared variables
Which of the following statements is true about the let keyword in JavaScript?
A). a. Variables declared with let have global scope
B). b. Variables declared with let are block-scoped
C). c. let is used to declare constants
D). d. let is used to declare functions