0
For the last question.. Can someone explain how a became 2 ?
3 odpowiedzi
0
Please explain question properly.
0
First, var a is declared and initialized to be 0.
a is now equal to 0.
Second, a is initialized to be 1, because 1 is counted up to a before the rest of the line will be executed.
Third, let b is declared and initialized to be a, which is now 1.
a is now equal to 1.
b is now equal to 1.
Fourth, let c is declared and initialized to be a, which is now 1, because a is set to be the value of c before the rest of the line will be executed.
Fifth, a is initialized to be 2, because 1 is counted up to a.
a is now equal to 2.
b = now equal to 1.
c = now equal to 1.
Understood?
0
Got it. Thanks