Javascript undefined Type Question 1

Introduction

What is the output of the following code?


var a1;

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


a is undefined

Javascript if check undefined is not used.

A string undefined is a special Javascript value that means a value does not exist.




PreviousNext

Related