Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
/* Get Programming with JavaScript
 * Listing 11.06
 * Global and local variables
 */
var mountain;
var show;
mountain = "Ben Nevis";
show = function () {
    var secretMountain = "Devils Tower";
    console.log(mountain);
    console.log(secretMountain);
};
show();
console.log(mountain);
console.log(secretMountain);                                           
/* Further Adventures
 *
 * 1) At the prompt, assign mountain a new value.
 *
 * 2) Call show at the prompt.
 *
 */
Output

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

Dismiss x
public
Bin info
jrlarsenpro
0viewers