result of console.log
kaitlynnT (1)

This is my code(JS) as below

let x = 3

It showed 3 instead of 4.

please help to answer it.

You are viewing a single comment. View All
a5rocks (774)

x++ returns the previous x, ++x returns the new x.

Both increment so this would work:

let x = 3;
x++; // or ++x;
kaitlynnT (1)

@a5rocks thanks for your help!