++ and —

Im not really understanding this ++ and —- 

As in:

let a = 0

undefined

a ++

0

a +1

2

I’m stuck on what a javascript increment does?

Brains not working on the “card counting” section today. Feel Im just at the door of my mind being opened a little k

  • I worked it out. 

let a = 7

undefined

a

7

a++

7

a

8

++a

9

So the a++ and the ++a are essentially the same think but show result differently.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s