how do javascript increment attribute works? [duplicate]

i’m trying to do some incrementation and decrementation in javascript, but it’s not working
i don’t know if the problem is the console or the actual version of the JS.
i’m a beginner user of stack overflow

var a = 2; var b = a++; console.log(b)//

the result is still 2