Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #15934

Re: Question on closure

From JJ <jaejunks_at@_googlemail_dot._com>
Newsgroups comp.lang.javascript
Subject Re: Question on closure
Date 2012-09-17 21:47 +0000
Organization A noiseless patient Spider
Message-ID <XnsA0D23131E8AC0jaejunksgooglemailco@0.0.0.50> (permalink)
References <e75bb2b7-b525-44d2-a957-5cf70ef25773@z8g2000yql.googlegroups.com> <XnsA0D1CBA63824Cjaejunksgooglemailco@0.0.0.50> <2rle589b4vsrkfkdahh9f78t8vrkg69t3n@4ax.com> <k37m9b$1i8$1@speranza.aioe.org> <v33f58pm2r4a20n2pkj3ieadccu0aauhle@4ax.com>

Show all headers | View raw


Gene Wirchenko <genew@ocis.net> wrote:

> On Mon, 17 Sep 2012 19:23:01 +0200, Christoph Becker
> <cmbecker69@gmx.de> wrote:
> 
> [snip]
> 
>>Try the following variation of JJ's code:
>>
>>function Counter() {
>> var theValue = 0;
>> return {
>>   getVal: function() {
>     ^^^^^^^^^^^^^^^^^^
>      Could you please give me pointer to where this syntax is
> discussed?  I tried the standard, but what I found -- sections 12.1
> Block and 12.12 Labelled Statements -- is remarkably opaque.  Do I
> even have the correct section(s)?  Do you know of something that
> explains it better?
> 
> [snip]
> 
> Sincerely,
> 
> Gene Wirchenko

Maybe this can help you understand it easier.

https://developer.mozilla.org/en-
US/docs/JavaScript/Guide/Working_with_Objects

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Question on closure justaguy <lichunshen84@gmail.com> - 2012-09-15 13:01 -0700
  Re: Question on closure JJ <jaejunks_at@_googlemail_dot._com> - 2012-09-17 12:57 +0000
    Re: Question on closure justaguy <lichunshen84@gmail.com> - 2012-09-17 09:14 -0700
    Re: Question on closure Gene Wirchenko <genew@ocis.net> - 2012-09-17 10:02 -0700
      Re: Question on closure Christoph Becker <cmbecker69@gmx.de> - 2012-09-17 19:23 +0200
        Re: Question on closure Gene Wirchenko <genew@ocis.net> - 2012-09-17 11:13 -0700
        Re: Question on closure Gene Wirchenko <genew@ocis.net> - 2012-09-17 13:56 -0700
          Re: Question on closure JJ <jaejunks_at@_googlemail_dot._com> - 2012-09-17 21:47 +0000
          Re: Question on closure Stefan Weiss <krewecherl@gmail.com> - 2012-09-18 00:06 +0200
            Re: Question on closure Gene Wirchenko <genew@ocis.net> - 2012-09-17 19:55 -0700
            Re: Question on closure Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-18 11:14 +0200
  Re: Question on closure Christoph Becker <cmbecker69@gmx.de> - 2012-09-17 19:32 +0200
    Re: Question on closure justaguy <lichunshen84@gmail.com> - 2012-09-17 11:16 -0700

csiph-web