You attempted to use an identifier that the JScript compiler does not recognize. The undefined value is returned whenever you use:
To correct this error
Declare the variable with a var statement (as in var x;).
JScript Variables | Variable Scope