Multiple choice technology testing

What is the statement that can be used to make VB Script, mandate variable declaration?

  1. Option Declare

  2. Option Explicit

  3. Option Mandate

  4. None

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Option Explicit is the VBScript statement that forces explicit declaration of all variables before use. This helps catch typos and undeclared variable errors at runtime, improving code reliability and debugging.

AI explanation

Option Explicit is the VBScript statement that forces every variable to be explicitly declared (typically with Dim, Set, or similar) before it's used, catching typos and undeclared-variable bugs at parse time instead of letting VBScript silently auto-create variables. Without it, VBScript allows implicit variable creation on first use, which is exactly the loose behavior this statement is meant to prevent.