This is a page containing basic javascript.

Task 1

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.

Task 2

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"

Task 3

(See console.)

Task 4

(See console.)

Task 5

Task 6

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.

Task 7

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.

Task 8

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.

Task 9

(See console.)