Javascript undefined Type Question 2

Introduction

What is the output of the following code?


if (a2 === undefined) {
    console.log("a2 is undefined");
} else {
    console.log("a2 is defined");
}

Answer
RefError: a is not defined

Note

We have not use var to define a2.




PreviousNext

Related