How do you assign a variable to have a value of 'Null'?
A). Using the assignment operator =.
B). Using the null keyword.
C). Using the undefined keyword.
D). Using the void operator.
Which statement best describes the relationship between 'Undefined' and 'Null' in JavaScript?
A). Undefined and Null are interchangeable and can be used interchangeably in code.
B). Undefined and Null are distinct values representing different states in JavaScript.
C). Undefined is a subset of Null, encompassing all possible values of Null.
D). Null is a subset of Undefined, encompassing all possible values of Undefined.
Which of the following is an example of using 'Null' in JavaScript?
A). let user = null;
B). let user = undefined;
C). let user;
D). let user = '';
How do you check if a variable has an 'Undefined' value in JavaScript?
A). Using the undefined keyword.
B). Using the null keyword.
C). Using the typeof operator.
D). Using the empty keyword.
When does the JavaScript engine assign an 'Undefined' value to a variable?
A). When the variable is intentionally set to 'Undefined'.
B). When the variable is not declared but used.
C). When the variable is declared but not initialized.
D). When the variable is initialized with the value 'Undefined'.
Which of the following statements is correct regarding the comparison of 'Undefined' and 'Null'?
A). Undefined and Null are strictly equal in JavaScript.
B). Undefined and Null are not strictly equal in JavaScript.
C). Undefined is considered a subtype of Null.
D). Null is considered a subtype of Undefined.
What happens when a function does not explicitly return a value in JavaScript?
A). It returns 'null'.
B). It returns 'undefined'.
C). It throws an error.
D). It returns 'object'.
What is the purpose of using 'Null' over 'Undefined' in certain programming scenarios?
A). To represent an intentional absence of value or object reference.
B). To assign default values to variables.
C). To represent uninitialized variables.
D). To check for variable existence.
Which statement is true regarding the use of 'Undefined'?
A). Undefined is commonly used to reset variables in loops.
B). Undefined is generally avoided and considered a programming error.
C). Undefined is used to represent empty strings.
D). Undefined is only used in function declarations.
What is the result of the expression typeof undefinedVariable if undefinedVariable is not declared?
A). object
B). function
C). undefined
D). null