Jump to content
Killersites 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×