Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Javascript Undefined Values

    • 0
    • 2
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 125
    Comment on it

    Javascript Undefined Values

    In a program the variables declared gets the value at the time of the variable declaration or get assigned after some calculation or received by the user input, but the variables which are not assigned any value at the time of the declaration are Undefined variables.

    We can say that the variables declared without a value have the value undefined.

    For Example:

    <!DOCTYPE html>
    <html>
    <body>
    
    <p id="demo"></p>
    
    <script>
    var name;
    document.getElementById("demo").innerHTML = name;
    </script>
    
    </body>
    </html>
    

    Output

    undefined

    As in the above example the variable name declared but didn't assigned any value that means the variable has a value Undefined. So, as a result we get the output as undefined.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: