-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay50.js
More file actions
9 lines (4 loc) · 741 Bytes
/
Day50.js
File metadata and controls
9 lines (4 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
let number = 0; //*- This line declares a variable number and initializes it with the value 0.
console.log(number++); //*- This line prints the current value of number and then increments it by 1. The number++ operation is a post-increment operation, which means it returns the value before it was incremented. So, 0 is printed to the console, and number is incremented to 1.
console.log(++number); //* This line increments the value of number by 1 and then prints it. The ++number operation is a pre-increment operation, which means it increments the value before returning it. So, number is incremented to 2, and 2 is printed to the console.
console.log(number); //* - This line simply prints the current value of number, which is 2.