Hi
Is it not possible to create a private method in an object ( which is essentially a function ) ?
displays 0, 3 when I thought it would display 2, 3.Code JavaScript:function foo1() { this.m = 0; function foo2() { this.m = 2; } this.foo3 = function() { this.m = 3; } foo2(); } var f = new foo1(); alert(f.m); f.foo3(); alert(f.m);
Thanks





Bookmarks