Variables have an 'Undefined' value when they are declared but not initialized, meaning they exist in memory but haven't been given a specific value yet.
Using 'Undefined' to represent missing or uninitialized values is discouraged as it can lead to unexpected behavior and is often considered a mistake in programming.
5.
When does the JavaScript engine assign an "Undefined" value to a variable?
When attempting to access a variable that has not been declared, JavaScript returns 'undefined' as the result of the expression 'typeof undefinedVariable'.
8.
Which of the following is a valid use case for "Null" in JavaScript?
Using 'Null' to explicitly clear or reset object references is a valid use case in JavaScript, especially when managing complex data structures or dealing with object lifecycles.
9.
How do you assign a variable to have a value of "Null"?
You can assign a variable to have a value of 'Null' by explicitly using the null keyword during variable assignment, indicating an intentional absence of value.
10.
Which of the following statements is correct regarding the comparison of "Undefined" and "Null"?
Although 'Undefined' and 'Null' are both falsy values in JavaScript, they are not strictly equal as they represent different states of absence or presence of value.