Revisions

gist: 167593 Download_button fork
public
Public Clone URL: git://gist.github.com/167593.git
Embed All Files: show embed
Namespaces for JavaScript #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var scoper = function() {
  var a = 2;
  var b = 3;
  var c = 42;
  
  return {
    foo: function() { return a },
    bar: function(g) { a = g }
  };
};
 
 
var q = scoper();
q.bar(42)
q.foo()
q.maple = function() { return this.b}
#undefined