Variables

Let's create some primitive variables. Let's start a good habit by using the keyword var.
Make sure to complete your work in the console.

  1. Create a variable named number, and assign a number value to it.
    • Hint: var number = x;
  2. Create a variable named boolean, and assign a boolean value to it.
  3. Create a variable named string, and assign a string value to it.
    • Hint: strings need to be wrapped in quotation marks.
  4. Create a variable named notDefined, and don't assign any value to it.
    • Note: the name undefined is restricted, as it global variable used by JavaScript.
  5. Make sure your variables were stored correctly by typing each of them in the console and hitting return.
    • Hint: If a value was assigned to the variable, you should see it returned in the console.
  6. Check whether you assigned the correct variables by passing your variables to the function validateVariables(number, boolean, string, notDefined);.
    • Note: This is a function I added to help check your work.