Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="JS Scope 3">
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
  msg = 'Global';
  
  function testScope(){
    console.log('Printing inside the scope - ' + msg);
    var msg = 'Local';
    console.log('Printing inside the scope - ' + msg);
  }
  
  testScope();
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
siddharthbhagwanpro
0viewers