/
How do we add and increment Javascript numbers?

How do we add and increment Javascript numbers?

Here are some examples:

var SLIDEindex = 1; SLIDEindex = SLIDEindex + 1; // increment by one SLIDEindex++; // This is short hand for increment by 1

We can do things like add and subtract numbers together, divide, multiply etc.

var DIGITone = 100; var DIGITtwo = 200; var SUMtotal = DIGITone + DIGITtwo;

 

Related content

Javascript Variables - Covering the core types
Javascript Variables - Covering the core types
More like this
How can I get part of string?
How can I get part of string?
Read with this
Javascript is a dynamic language
Javascript is a dynamic language
More like this
How can we make a string with embedded " or ' characters?
How can we make a string with embedded " or ' characters?
Read with this
Javascript Arrays
Javascript Arrays
More like this
How do I change the case of a string?
How do I change the case of a string?
Read with this