Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Javasrcipt level 3 lesson 3

I am trying to increment the variable p by one and it doesn't seem to work regardless of what i try.
ex.
let p = 12++;
console.log(p);
This returns 12.
ex.
let p = 12;
console.log(p++);
This returns invalid left-hand side expression in postfix operation.
I am confused.
by

1 Answer

MICHAELn0v6h
I figured it out.
let p = 12;
p++;
console.log(p);

Login / Signup to Answer the Question.