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


Groups > comp.lang.javascript > #16129

Re: silly question on closure

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: silly question on closure
Date 2012-09-23 18:49 +0200
Organization albasani.net
Message-ID <k3nejp$6v3$1@news.albasani.net> (permalink)
References <a9704993-d83a-4392-8a65-82755e9ba320@u15g2000yql.googlegroups.com> <505dfcdb$0$6848$e4fe514c@news2.news.xs4all.nl> <02f07c90-fde4-4cc6-b44b-95239771c06d@m9g2000yqi.googlegroups.com> <7008a319-a3c7-43b4-9a05-dd1db287472f@l14g2000yqo.googlegroups.com>

Show all headers | View raw


On 2012-09-23 16:31, justaguy wrote:
> Ok, I've implemented closure with my app, and now I see its beauty, in
> the meantime, I don't know why
> ++value;
> would increment by 2.
> I attempted with
> +value to no avail

The ++ operator increments by 1, not 2.
The unary + operator does not increment at all.

This is basic syntax. I think you would profit enormously from reading
this guide:

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

Chapter 5 is about expressions and operators, chapter 14 is about closures.

- stefan

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


Thread

silly question on closure justaguy <lichunshen84@gmail.com> - 2012-09-22 05:04 -0700
  Re: silly question on closure Stefan Weiss <krewecherl@gmail.com> - 2012-09-22 18:18 +0200
    Re: silly question on closure justaguy <lichunshen84@gmail.com> - 2012-09-22 18:41 -0700
    Re: silly question on closure Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-24 01:10 +0200
      Closures (was: silly question on closure) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-24 13:14 +0200
      Re: silly question on closure Stefan Weiss <krewecherl@gmail.com> - 2012-09-27 05:04 +0200
        Re: silly question on closure Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-27 20:50 +0200
          Re: silly question on closure Stefan Weiss <krewecherl@gmail.com> - 2012-09-27 21:29 +0200
  Re: silly question on closure "Tom de Neef" <tdeneef@qolor.nl> - 2012-09-22 20:00 +0200
    Re: silly question on closure justaguy <lichunshen84@gmail.com> - 2012-09-22 18:42 -0700
      Re: silly question on closure justaguy <lichunshen84@gmail.com> - 2012-09-23 07:31 -0700
        Re: silly question on closure Stefan Weiss <krewecherl@gmail.com> - 2012-09-23 18:49 +0200
          Re: silly question on closure justaguy <lichunshen84@gmail.com> - 2012-09-23 13:33 -0700
          Re: silly question on closure justaguy <lichunshen84@gmail.com> - 2012-09-23 13:38 -0700
            Re: silly question on closure Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-24 20:49 +0200
    Re: silly question on closure Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-24 01:14 +0200
  Re: silly question on closure dann90038@gmail.com - 2012-09-23 15:37 -0700

csiph-web