How do you add in a different order other than i++ ? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

How do you add in a different order other than i++ ?

I’m a Rookie to JavaScript and I’m really interested to know how do u add number in, 2’s and 3’s and 4’s or any other synonymous way other than i++! I hope someone will come with a great example along with explanation ! Thanks in advance 😁

27th Feb 2018, 9:29 AM
Raaja Thalapathy
Raaja Thalapathy - avatar
2 Antworten
+ 1
i+=3 for example, which is equivalent to i = i + 3; Works with variables and different operators too. Examples: i*=7; i%=2; i\=x;
27th Feb 2018, 3:02 PM
Kai Schlegel
Kai Schlegel - avatar
+ 1
Oh wow ! That’s cool Thank You So Much @Kai Schlegel 🙌🏻
28th Feb 2018, 12:34 PM
Raaja Thalapathy
Raaja Thalapathy - avatar