Use global variable with undefined value - Javascript Data Type

Javascript examples for Data Type:undefined

Description

Use global variable with undefined value

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {//ww  w  .  ja v a 2 s  .c  om
var test = 'start';
function end(){
    test = 'end';
    var test = 'local';
}
end();
console.log(test);
    });

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials