Question: What happens if you try to add together name and age?
Answer: When you try to add together a string and an integer, the string and integer get joined together into a seperate string.
Question: What happens when you change one of the variables into a string?
Answer: When you try to add together a string and an integer, the string and integer get joined together into a seperate string. For example: 1 + "2" = "12"
(See console.)
(See console.)
Question: What happens when you try to add a string and a number?
Answer: When you try to add together a string and an integer, the string and integer get joined together into a seperate string.
Question: Explore and explain what the result of the code below is.
Answer: The result is the same as if you did the proper math. JavaScript knows how to do math with parentheses.
Question: Explore and explain what happens with the variable when you write various things.
Answer:
+=10 adds 10 to the variable.
-=10 removes 10 from the variable.
*=2 times the variable by 2.
/=2 halves the variable.
%=7 divides the variable by seven and sets it to the remainder.
%=5 does the same as %= 7, just divided by 5 instead of 7.
++ adds 1 to the variable.
-- removes 1 from the variable.
(See console.)