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>
 
var result = (function() {
  var f = function g() {
    return 1;
  };
  // g is only available within the expression.
  // g can call g within itself.
  // Adding parentheses makes it easier to visualize:
  var ff = (function gg() { return 1; });
  return g();
})();
console.log(result); // ReferenceError: g is not defined
Output

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

Dismiss x
public
Bin info
miguelmotapro
0viewers