The aim of the tests on this page is to assess whether you've understood the Basic math in JavaScript — numbers and operators article.

Note: If there is an error in your code, it will be logged into the results panel on this page (or in the browser's JavaScript console for the downloadable version) to help you. It might be helpful to copy the code into an online tool like CodePen, jsFiddle, or Glitch to test your work. If you get stuck, you can ask us for help.

## Math 1

Let's start out by testing your knowledge of basic math operators. You will create four numeric values, add two together, subtract one from another, then multiply the results. Finally, we need to write a check that proves that this value is an even number.

Try updating the live code below to recreate the finished example by following these steps:

1. Create four variables that contain numbers. Call the variables something sensible.
2. Add the first two variables together and store the result in another variable.
3. Subtract the fourth variable from the third and store the result in another variable.
4. Multiply the results from steps 2 and 3 and store the result in a variable called `finalResult`.
5. Check if `finalResult` is an even number using an arithmetic operator and store the result in a variable called `evenOddResult`.

To pass this test, `finalResult` should have a value of `48` and `evenOddResult` should have a value of `0`.

## Math 2

In the second task, you are provided with two calculations with the results stored in the variables `result` and `result2`. You need to take the calculations, multiply them, and format the result to two decimal places.

Try updating the live code below to recreate the finished example by following these steps:

1. Multiply `result` and `result2` and assign the result back to `result` (use assignment shorthand).
2. Format `result` so that it has two decimal places and store it in a variable called `finalResult`.
3. Check the data type of `finalResult` using `typeof`. If it's a `string`, convert it to a `number` type and store the result in a variable called `finalNumber`.

To pass this test, `finalNumber` should have a result of `4633.33`.

## Math 3

In the final task for this article, we want you to write some tests. There are three groups, each consisting of a statement and two variables. For each one, write a test that proves or disproves the statement made. Store the results of those tests in variables called `weightComparison`, `heightComparison`, and `pwdMatch`, respectively.