JavaScript Global and Local Variable


Want to understand Properly Plz see the video carefully on YouTube channel name is Adisma


 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var a = 10;
        function display(){
             var a = 20;
            document.write("ADISMA <br>");          
            document.write(a + "<br>");  
        }
        var a = 30;
        display();
        document.write(a);
    </script>
</body>
</html>

Comments

Popular posts from this blog

Javascript Array Concat and Join Method

JavaScript While Loop

JavaScript pop() Method