Northcentral Technical College Introduction To Programming
10-152-310
Introduction to Programming with JavaScript NTC 10-152-310

Learning Plan 6 6.1 Lab 2

# 6.1 Lab 2

#### File: /Learning Plan 6/6.1lab2.html

### Student

- Name:
- Section:
- Email:

### Lab Steps

1. Open this file in Firefox and Microsoft Visual Studio.
2. Add your name, section, and email.
3. Open the file `/Learning Plan 6/jsFiles/6.1lab2.js` in Microsoft Visual Studio.
4. Lab Steps:
   1. Open the HTML file `/Learning Plan 6/6.1lab2.html` and find the `<ol id="outputList">` tag. You will be adding `<li>` tags to this with JavaScript.
   2. Add a `global` variable named `fullName` at the top of the file.
   3. Create a function after the global variable named `printFullName()`.
   4. In the new `printFullName()` function:
      1. Create a `local` variable named `fullName`.
      2. Assign the local variable the name, "Bill Smith".
      3. Add a list item to the HTML ordered list with the id of "outputList" with the `local` fullName variable as the data.
   5. In the function `lab61_2()`:
      1. Assign the name "Judy Green" to the global variable version of fullName.
      2. Add a list item to the HTML ordered list with the id of "outputList" with the `global` fullName variable as the data.
      3. Call the `printFullName()` function.
   6. Inside of a function, which variable has precedence?

### Example Output

1. Judy Green
2. Bill Smith

### Your Output: