New course! Every coder should learn Generative AI!
Try a free lesson0
Jordan The value of variable Y is 8, which you typecasted in the same variable and then added 2 to 8 which is now a string and as Angelo said strings are concatenated not added, so: '8'+'2' = 82
+ 2
Where does the 7 come from?
Btw remember that
"ab" + "cd" == "abcd"
So "8" + "2" == "82"
+ 1
It's not 8, it's "8"
0
One tip: No two variables should be same in a program