Jump to content
Stef's Coding Community
Sign in to follow this  
webmanz

What does i stand for in i - - ?

Recommended Posts

What does  the " i " stand for in i - -  ? Special meaning?

for ( var   i   =  10  ;    i   > 10   ;  i -  -   )

 

and is  the above same as saying:

var i=10;

i  > 10;

i = i - 1;

Share this post


Link to post
Share on other sites
On 5/6/2018 at 1:10 PM, administrator said:

Hi,

i is just a variable to hold information. In this case, it is holding the count.

Stef

Could we have used any letter besides "i" and still it work?

example:

for ( var   t   =  10  ;    t   > 10   ;  t -  -   )

Share this post


Link to post
Share on other sites
5 hours ago, administrator said:

Sure.

for ( var   i   =  10  ;    i   > = 10   ;  i -  -   )

Why doesn't the  i - -

end in a semi-colon then parenthesis ?

i.e. like this:

i - - ; )

 

 

Edited by webmanz

Share this post


Link to post
Share on other sites
On 5/16/2018 at 10:46 PM, webmanz said:

end in a semi-colon then parenthesis ?

Wow ... old post. Last argument does not need a semi-colon. 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...