JavaScript/Primitive data types/Exercises

Topic: Primitive Data Types

1. Write a script with the following steps (the 'power'-operator is '**'):
 * Compute the value of 250. Store it in the variable.
 * Compute the value of 250 + 1. Store it in the variable.
 * Compare  with  . Are they equal?

2. Repeat the previous exercise with 260 instead of 250.

3. Repeat the previous exercise with 1000 instead of 1.

4. Discuss the results of exercises 1 - 3 with your colleague.

5. Write a script with the following steps:
 * Compute the value of one divided by three. Store the result in the variable.
 * Show.
 * Multiply  by three and store the result in.
 * Show . Which value do you expect?

6. Write a script that shows that 5 and 5.0 are identical values.

7. Write a script that
 * asks the user how old he is:
 * always returns a string. To perform the calculation, it's necessary to convert the answer to number,  ,
 * if his answer is a numeric value, show how often his heart has beaten since his birth (approximately once per second)
 * else, give a message like "Sorry. We need a numeric value to perform the computation."

8. Create a HTML page for the previous exercise and embed the solution into the HTML. You can refer to this example.

{9. What shows the 'alert' statement? - 3.14 - float + number - undefined - None of the above
 * type=""}