How to use undefined Property in JavaScript

This article describe about undefined Property in JavaScript.
  • 1865

undefined Property in JavaScript

If variable has not assigned value then it is indicated by the undefined property.

Example

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

    var a = "";

    var b;

    if (a == undefined) {

        document.write("a is undefined");

    }

    if (b == undefined) {

        document.write("b is undefined");

    }

</script>

</body>

</html>

Output

pic6.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.