| title | slug |
|---|---|
Exercise: JS Introduction and Variables |
/js-introduction-and-variables-exercise |
Your objective is to begin using variables to store and pass values throughout your program.
To see your work, you can log, or print, the values stored in your variables to the console. Use
console.log(variableName)to see your results in the browser console.
Steps are to be completed in the app.js file.
- Declare a variable named
firstNameusing theconstkeyword - Declare a variable named
lastNameusing theletkeyword - Declare a variable named
ageusing thevarkeyword
Steps are to be completed in the app.js file.
- Assign your first name as the string value to the variable
firstName - Assign your last name as the string value to the variable
lastName - Assign your age as the number value to the variable
age
Steps are to be completed in the app.js file.
- Declare a variable named
languageusing theletkeyword, and assign it the value"JavaScript"(string) - Declare a variable named
createdYearusing theletkeyword, and assign it the value1995(number) - Declare a variable named
isCaseSensitiveusing theletkeyword, and assign it the valuetrue(boolean)
Steps are to be completed in the app.js file.
- Declare a variable named
priceusing theletkeyword, and assign it the value19.99(number) - Declare a variable named
isOnSaleusing theletkeyword, and assign it the valuefalse(boolean) - Declare a variable named
salePercentageusing theletkeyword, and assign it the value15(number) - Declare a variable named
stockusing theletkeyword, and assign it the value0(number) - Declare a variable named
inStockusing theletkeyword, and assign it the valuefalse(boolean) - Declare a variable named
selectedSizeusing theletkeyword, and assign it the value"M"(string)
Steps are to be completed in the app.js file.
- Declare a variable named
titleusing theletkeyword, and assign it the value"Name of the Wind"(string) - Declare a variable named
authorusing theletkeyword, and assign it the value"Patrick Rothfuss"(string) - Declare a variable named
pageCountusing theletkeyword, and assign it the value722(number) - Declare a variable named
bookmarkusing theletkeyword, and assign it the value456(number) - Declare a variable named
hasReadusing theletkeyword, and assign it the valuetrue(boolean)