JavaScript_Variables
Steps
- Fork this repository to start a new project in your
repos
folder ==git clone <your github repo url>
cd JavaScript_Variables
to navigate into your new repo directory- Type the command
code .
to open VSC with the JavaScript_Variables folder - Open the app.js file
Exercise 1: Declaring Variables
- Declare a variable named firstName using the
const
keyword, and assign your name as the string value - Declare a variable named lastName using the
let
keyword, and assign your name as the string value - Declare a variable named age using the
var
keyword, and assign your age as the number value
Exercise 2: Working with Strings
- Declare a variable named fullName using the
let
keyword, and assign yourfirstName
plus yourlastName
as the string value - Print the value of
fullName
to the console (to open you browser console in Google Chrome, right-click and press "Inspect" or fn+F12) - BONUS: Complete step two using a template literal instead of concatenation
Exercise 3:
- 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.
- An introduction using your
- Be sure to use variables as the above answers (declare and assign variables if you haven't already)
- 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!`;