Skip to main content
Search
Search This Blog
Still a Student !
Learning Everyday !!
Home
More…
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
May 05, 2021
Javascript Practice 28: JS Hero - Increment
Question:
Which value does x have after execution of the following code?
let x = 3;
x++;
x = x * 2;
x--;
Answer:
x has a value of 7
> x = 3
> x++: 3+1 = 4
> x = x*2; i.e. 4*2 = 8
> x--: 8-1 = 7
Comments
Popular Posts
July 20, 2021
Junior Developer Central JS Practice Exercise - 22
July 19, 2021
Junior Developer Central JS Practice Exercise - 20
Comments
Post a Comment