charr1309 / JavaScript_Variables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaScript_Variables

Steps

  1. Fork this repository to start a new project in your repos folder == git clone <your github repo url>
  2. cd JavaScript_Variables to navigate into your new repo directory
  3. Type the command code . to open VSC with the JavaScript_Variables folder
  4. Open the app.js file

Exercise 1: Declaring Variables

  1. Declare a variable named firstName using the const keyword, and assign your name as the string value
  2. Declare a variable named lastName using the let keyword, and assign your name as the string value
  3. Declare a variable named age using the var keyword, and assign your age as the number value

Exercise 2: Working with Strings

  1. Declare a variable named fullName using the let keyword, and assign your firstName plus your lastName as the string value
  2. Print the value of fullName to the console (to open you browser console in Google Chrome, right-click and press "Inspect" or fn+F12)
  3. BONUS: Complete step two using a template literal instead of concatenation

Exercise 3:

  1. Declare a variable named myStory using the let keyword, and assign a string with 3 sentences detailing:
    • An introduction using your fullName variable.
    • An introduction using your city variable.
    • An introduction using your favorite passtime variable.
  2. Be sure to use variables as the above answers (declare and assign variables if you haven't already)
  3. Print the result of myStory to the browser console

Ex:

let myStory = `\Hello! My name is ${fullName}. I live in ${city}. I enjoy ${passtime} and coding!`;

About


Languages

Language:HTML 75.3%Language:JavaScript 24.7%