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


Groups > comp.lang.javascript > #37327

Re: What does this line of code mean?

From "R.Wieser" <address@not.available>
Newsgroups comp.lang.javascript
Subject Re: What does this line of code mean?
Date 2019-09-22 15:39 +0200
Organization Aioe.org NNTP Server
Message-ID <qm7tik$cpf$1@gioia.aioe.org> (permalink)
References <f27ce718-9b0b-4641-86f1-bfc079462875@googlegroups.com>

Show all headers | View raw


groovee,

> I always thought the 3rd thing in a "for" HAD to be "something++"
> or "something--"

Both "something++"  and or "something--" are just changing "something".  In 
your described cases, by one.

But you can write "something++" differently.  Like "something += 1" or even 
"something = something + 1".   All three wil work (try it!).

And with any assignment you can put whole calculations at the right of the 
"=" (like "anything = anything / 2 + 1"), or even expressions which calls 
other functions and/or methods.    Which is what happens in your case.

Hope that helps.

Regards,
Rudy Wieser

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


Thread

What does this line of code mean? groovee@cyberdude.com - 2019-09-21 11:15 -0700
  Re: What does this line of code mean? Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-09-21 18:30 +0000
  Re: What does this line of code mean? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-09-22 11:25 +0100
    Re: What does this line of code mean? Julio Di Egidio <julio@diegidio.name> - 2019-09-22 04:53 -0700
      Re: What does this line of code mean? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-09-22 15:40 +0100
        Re: What does this line of code mean? "R.Wieser" <address@not.available> - 2019-09-22 19:01 +0200
          Re: What does this line of code mean? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-09-23 11:13 +0100
            Re: What does this line of code mean? "R.Wieser" <address@not.available> - 2019-09-23 14:15 +0200
    Re: What does this line of code mean? groovee@cyberdude.com - 2019-09-25 12:20 -0700
  Re: What does this line of code mean? "R.Wieser" <address@not.available> - 2019-09-22 15:39 +0200
    Re: What does this line of code mean? Julio Di Egidio <julio@diegidio.name> - 2019-09-22 06:57 -0700
      Re: What does this line of code mean? "R.Wieser" <address@not.available> - 2019-09-22 18:49 +0200

csiph-web