Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
1 change: 1 addition & 0 deletions JavaScript_Variables
Submodule JavaScript_Variables added at e36036
110 changes: 55 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
---
title: "Exercise: JS Introduction and Variables"
slug: "/js-introduction-and-variables-exercise"
---

## Objective

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.

## Exercise 1: Declaring Variables

Steps are to be completed in the `app.js` file.

1. Declare a variable named `firstName` using the `const` keyword
2. Declare a variable named `lastName` using the `let` keyword
3. Declare a variable named `age` using the `var` keyword

## Exercise 2: Assigning Values to Variables

Steps are to be completed in the `app.js` file.

1. Assign your first name as the **string** value to the variable `firstName`
2. Assign your last name as the **string** value to the variable `lastName`
3. Assign your age as the **number** value to the variable `age`

## Exercise 3: Declaring and Assigning Values to Variables

Steps are to be completed in the `app.js` file.

1. Declare a variable named `language` using the `let` keyword, and assign it the value `"JavaScript"` (string)
2. Declare a variable named `createdYear` using the `let` keyword, and assign it the value `1995` (number)
3. Declare a variable named `isCaseSensitive` using the `let` keyword, and assign it the value `true` (boolean)

## Exercise 4: Declaring and Assigning Values to Variables x2

Steps are to be completed in the `app.js` file.

1. Declare a variable named `price` using the `let` keyword, and assign it the value `19.99` (number)
2. Declare a variable named `isOnSale` using the `let` keyword, and assign it the value `false` (boolean)
3. Declare a variable named `salePercentage` using the `let` keyword, and assign it the value `15` (number)
4. Declare a variable named `stock` using the `let` keyword, and assign it the value `0` (number)
5. Declare a variable named `inStock` using the `let` keyword, and assign it the value `false` (boolean)
6. Declare a variable named `selectedSize` using the `let` keyword, and assign it the value `"M"` (string)

## Exercise 5: Declaring and Assigning Values to Variables x3

Steps are to be completed in the `app.js` file.

1. Declare a variable named `title` using the `let` keyword, and assign it the value `"Name of the Wind"` (string)
2. Declare a variable named `author` using the `let` keyword, and assign it the value `"Patrick Rothfuss"` (string)
3. Declare a variable named `pageCount` using the `let` keyword, and assign it the value `722` (number)
4. Declare a variable named `bookmark` using the `let` keyword, and assign it the value `456` (number)
5. Declare a variable named `hasRead` using the `let` keyword, and assign it the value `true` (boolean)
---
title: "Exercise: JS Introduction and Variables"
slug: "/js-introduction-and-variables-exercise"
---
## Objective
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.
## Exercise 1: Declaring Variables
Steps are to be completed in the `app.js` file.
1. Declare a variable named `firstName` using the `const` keyword
2. Declare a variable named `lastName` using the `let` keyword
3. Declare a variable named `age` using the `var` keyword
## Exercise 2: Assigning Values to Variables
Steps are to be completed in the `app.js` file.
1. Assign your first name as the **string** value to the variable `firstName`
2. Assign your last name as the **string** value to the variable `lastName`
3. Assign your age as the **number** value to the variable `age`
## Exercise 3: Declaring and Assigning Values to Variables
Steps are to be completed in the `app.js` file.
1. Declare a variable named `language` using the `let` keyword, and assign it the value `"JavaScript"` (string)
2. Declare a variable named `createdYear` using the `let` keyword, and assign it the value `1995` (number)
3. Declare a variable named `isCaseSensitive` using the `let` keyword, and assign it the value `true` (boolean)
## Exercise 4: Declaring and Assigning Values to Variables x2
Steps are to be completed in the `app.js` file.
1. Declare a variable named `price` using the `let` keyword, and assign it the value `19.99` (number)
2. Declare a variable named `isOnSale` using the `let` keyword, and assign it the value `false` (boolean)
3. Declare a variable named `salePercentage` using the `let` keyword, and assign it the value `15` (number)
4. Declare a variable named `stock` using the `let` keyword, and assign it the value `0` (number)
5. Declare a variable named `inStock` using the `let` keyword, and assign it the value `false` (boolean)
6. Declare a variable named `selectedSize` using the `let` keyword, and assign it the value `"M"` (string)
## Exercise 5: Declaring and Assigning Values to Variables x3
Steps are to be completed in the `app.js` file.
1. Declare a variable named `title` using the `let` keyword, and assign it the value `"Name of the Wind"` (string)
2. Declare a variable named `author` using the `let` keyword, and assign it the value `"Patrick Rothfuss"` (string)
3. Declare a variable named `pageCount` using the `let` keyword, and assign it the value `722` (number)
4. Declare a variable named `bookmark` using the `let` keyword, and assign it the value `456` (number)
5. Declare a variable named `hasRead` using the `let` keyword, and assign it the value `true` (boolean)
46 changes: 36 additions & 10 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
console.log("Hello World!\n==========\n");
console.log(
"Follow the steps in the README.md file to complete the exercises:\n==========\n"
);

// Exercise 1

// Exercise 2

// Exercise 3

"Follow the steps in the README.md file to complete the exercises:\n==========\n"



//Excercise 1
const firstName = "Rosie";
let lastName = "Cotton";
var age = 15;

let language = "JavaScript";
let createdYear = 1995;
let isCaseSensitive = "true";

console.log(`${language} was first release in ${createdYear}.`);

let product = "T-shirty"
Let price = 19.99;
let isOnSale = false;
let salePercentage = 15;
let inStock = false;
let selectSize = "M";





}

Let title = "Name of the Wind";
Let author = Patrick Rothfuss;
Let pageCount = 722;
let bookMark = 456;
let hasRead = true;

console.log ('${title} by ${author} is ${pageCount} pages long.`)
52 changes: 31 additions & 21 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JavaScript Variables</title>
</head>
<body>
<main style="display: flex; justify-content: center; align-items: center">
<div>
<h1>Exercises: JavaScript Variables</h1>
<ul>
<li>Declaring Variables</li>
<li>Working with Strings</li>
<li>Primitive Type Practice</li>
</ul>
</div>
</main>
<script src="app.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JavaScript Variables</title>
</head>
<body>
<h1 id="glowText">JS:Intro and Variables</h1>
<button id="myButton">JS:Intro and Variables</button>
<main style="display: flex; justify-content: center; align-items: center">
<div>
<h1>Exercises: JavaScript Variables</h1>
<ul>
<li>Declaring Variables</li>
<li>Working with Strings</li>
<li>Primitive Type Practice</li>
</ul>
</div>
</main>
<script>
document.getElementById("myButton").addEventListener("click", function() {
alert("Button Clicked!");
});
</script>

<script src="app.js"></script>
</body>
</html>
64 changes: 64 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@


@keyframes glow {
0% {
text-shadow: 0 0 10px rgba(10, 55, 15, 0.7);
}
50% {
text-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
}
100% {
text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}
}

#glowText {

animation: glow 2s infinite;
}


#glowText {
font-size: 36px;
text-align: center;
color: #fff;
text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}









div {
background-color: rgb(170, 118, 219);
}


p {
background-color: #f4b5e6;
}

button {
background-color: hsl(294, 93%, 48%);
}

body {
background-color: rgb(149, 86, 132);
font-family: Arial,Impact, 'Arial Narrow Bold', sans-serif ;
}

h1 {
color: rgb(2, 2, 42);
}

#myButton {
background-color: #40045d;
color: #fff;
padding: 10px 20px;
border: none;
cursor: pointer;
}