Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
71a2c0a
Assignment 1: Variables
pmermod Oct 6, 2022
567cee1
Hal's correction of Assignment 1, 02-variables. Removed quotation mar…
pmermod Oct 6, 2022
a4f3d0e
Solutions to variables exercise
matinaspatsos Oct 12, 2022
13ef2d9
Include introductions for Quokka
matinaspatsos Oct 12, 2022
66b7c17
Numbers exercises
matinaspatsos Sep 25, 2022
4ce662c
Assignment 2
pmermod Oct 12, 2022
bac94a0
Strings exercises
matinaspatsos Oct 2, 2022
79eb82d
Assignment 03 - Hal Katzman
pmermod Oct 13, 2022
727771c
Fix bug with numbers test
matinaspatsos Oct 13, 2022
b895c95
Solutions for the numbers and strings exercise
matinaspatsos Oct 17, 2022
d4f42f3
Combine strings exercises
matinaspatsos Oct 2, 2022
fbf7fca
Coercion exercises
matinaspatsos Oct 2, 2022
e2897f9
Remove instructions on making a pull requests
matinaspatsos Oct 18, 2022
43142cb
Solutions for combine strings and coercion
matinaspatsos Oct 19, 2022
977d040
Control flow exercises
matinaspatsos Oct 16, 2022
52764a3
Comparisons exercise
matinaspatsos Oct 16, 2022
96ff2d6
add my name to the list
dreman8 Oct 20, 2022
ddc4fcd
Solutions for control flow and comparison exercises
matinaspatsos Oct 23, 2022
ca4f533
Functions exercise
matinaspatsos Oct 16, 2022
889b1e1
assignment 4 and 5 hkatzman
pmermod Oct 18, 2022
f155d8b
correct assignment 04-3
pmermod Oct 18, 2022
adeecfb
correct assignment 04-03 katzman
pmermod Oct 18, 2022
2055138
fix
pmermod Oct 19, 2022
41cacfc
prep for 7
pmermod Oct 20, 2022
2eea535
finish assignment 06 and 07 hal katzman
pmermod Oct 20, 2022
e4b2a4b
Submit assignment 08 Hal Katzman
pmermod Oct 25, 2022
3b74e4e
Functions solutions
matinaspatsos Oct 26, 2022
41bbabe
Arrays exercises
matinaspatsos Oct 23, 2022
46d80bc
Submit assignment 09 hal katzman
pmermod Oct 27, 2022
bbe8fbd
correct 06-02 hal katzman
pmermod Oct 31, 2022
2068a52
Arrays solutions
matinaspatsos Oct 29, 2022
3650910
Loops exercise
Oct 26, 2022
c328164
Update array instructions
matinaspatsos Oct 30, 2022
d786896
Loops exercise part 2
Oct 26, 2022
a255a68
Solutions for first half of loops exercise
matinaspatsos Nov 1, 2022
4a8159a
1st attempt at loops assignment
pmermod Nov 1, 2022
bd8ed3b
continue work on 10-loops problems
pmermod Nov 1, 2022
4f194f0
Work on problem 10-06 highest number hal katzman
pmermod Nov 1, 2022
4fc4066
Problem 10-6: made borrowed code my own
pmermod Nov 2, 2022
97ea228
Problem 10-06 add attribubtion and update
pmermod Nov 2, 2022
26811a7
Problem 10-07 palindrome and exercise 10-loops finished except for html
pmermod Nov 2, 2022
3484a75
10-Loops minor change
pmermod Nov 3, 2022
01f4999
Objects exercises
matinaspatsos Oct 29, 2022
0f64177
Problems 10-04 complete
pmermod Nov 3, 2022
0cad387
Problems 11-object initial work
pmermod Nov 3, 2022
bb074d4
Problems 11-01, 11-02, 11-03
pmermod Nov 3, 2022
1ee583b
Problem 11-02
pmermod Nov 4, 2022
1f58dab
Problem 11-04
pmermod Nov 4, 2022
6c27b20
Problem 11-04 a better solution
pmermod Nov 4, 2022
1b7a508
Problems 11-05 and 11-06
pmermod Nov 5, 2022
947c72a
Problem 11-02
pmermod Nov 5, 2022
e29c7f3
Problem 11-02 revise
pmermod Nov 5, 2022
923c529
Loops and object exercise solutions
matinaspatsos Nov 5, 2022
4262858
Loops with objects exercises
matinaspatsos Oct 29, 2022
a75fd50
More conditionals exercises
matinaspatsos Nov 5, 2022
dfe5f85
Problem 12-01 hal
pmermod Nov 9, 2022
98728cf
Problem 12-02 attempt Hal
pmermod Nov 9, 2022
0e37e33
Problem 13-01 Hal
pmermod Nov 9, 2022
2f8edac
Solutions for loops with objects and more conditionals exercises
matinaspatsos Nov 9, 2022
f315350
First project (hangman)
matinaspatsos Nov 12, 2022
d82218e
Callback exercises
matinaspatsos Nov 5, 2022
64a0cd3
Problem 15-01
pmermod Nov 17, 2022
cb164d5
Problems 15 - initial work
pmermod Nov 17, 2022
4b06aae
Callback solutions
matinaspatsos Nov 17, 2022
14f703e
More callback exercises
matinaspatsos Nov 21, 2022
acf1286
For each exercises
matinaspatsos Nov 5, 2022
41f820a
Problems 15-callbacks
pmermod Nov 24, 2022
2936407
Problems 16
pmermod Nov 24, 2022
f21c664
Solutions to some more callbacks and first forEach exercise
matinaspatsos Nov 22, 2022
99f97a3
Solution to final foreach problem
matinaspatsos Nov 27, 2022
f76da1a
Fix typos
matinaspatsos Nov 27, 2022
6bf419c
Targeting DOM exercises
matinaspatsos Nov 27, 2022
9794f21
Problems 17
pmermod Dec 1, 2022
bafa9e8
Remove "x-rary" from Hangman project word bank
matinaspatsos Nov 30, 2022
5841c85
Targeting DOM solutions
matinaspatsos Nov 30, 2022
9f55036
Transforming DOM exercises
matinaspatsos Dec 1, 2022
c86874b
Problems 18
pmermod Dec 6, 2022
205db69
DOM attributes exercise
matinaspatsos Dec 3, 2022
4d790d4
Fix image not loading in solution
matinaspatsos Dec 3, 2022
32fa94f
Solutions to transforming DOM exercises
matinaspatsos Dec 5, 2022
738efcf
Click events exercises
matinaspatsos Dec 3, 2022
5b8ec27
Problems 19
pmermod Dec 6, 2022
7e65412
Solutions to click event problems
matinaspatsos Dec 6, 2022
4dbc62c
Toggle events exercise
matinaspatsos Dec 3, 2022
2473a30
Problems 20
pmermod Dec 8, 2022
6edda3f
Solutions to toggle events exercises
matinaspatsos Dec 8, 2022
348c5d9
Forms exercises
matinaspatsos Dec 3, 2022
84dfc37
Final project
matinaspatsos Dec 10, 2022
eadf8b3
Problems 21 - 1 and 2
pmermod Dec 13, 2022
0bac11e
Problems 21 - 1 and 2 finishing
pmermod Dec 13, 2022
3e0a1fb
Problems 21 - 3 in progress
pmermod Dec 14, 2022
c90f5ae
Problems 21 - 3 in progress - additional work
pmermod Dec 14, 2022
86f7bee
Problems 21 - 3 in progress - additional work
pmermod Dec 14, 2022
9402b32
No slack
matinaspatsos Dec 13, 2022
a5812d0
Form exercises solutions
matinaspatsos Dec 14, 2022
8dbbb4c
Identifying an element in a group exercise
matinaspatsos Dec 11, 2022
763e18a
Cross site scripting (XSS) example
matinaspatsos Dec 14, 2022
b210834
Creating elements exercise
matinaspatsos Dec 10, 2022
baff8a8
Fix identify elements exercise
matinaspatsos Dec 15, 2022
0a31ea0
Fix
matinaspatsos Dec 15, 2022
ce15202
Problems 22 and 23 - Hal
pmermod Dec 18, 2022
33a0d8e
HTTP and REST APIs exercises
matinaspatsos Dec 17, 2022
6e69e79
Solutions for the identify elements exercise
matinaspatsos Dec 19, 2022
0a5d155
First axios exercise
matinaspatsos Dec 21, 2022
e591eaa
Problem 25 Axios - Hal
pmermod Jan 3, 2023
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
182 changes: 182 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,187 @@
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "2. Numbers",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/02-numbers/numbers.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "3. Strings",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/03-strings/strings.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "4. Combine Strings",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/04-combine-strings/combine-strings.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "5. Coercion",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/05-coercion/coercion.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "6. Control Flow",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/06-control-flow/control-flow-test-helper.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "7. Comparisons",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/07-comparisons/comparisons.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "8. Functions",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/08-functions/functions.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "9. Arrays",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/09-arrays/arrays-sets.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "10. Loops",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/10-loops/loops.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "11. Objects",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/11-objects/objects.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "12. Loops with Objects",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/12-loops-objects/loops-objects.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "13. More Conditionals",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/13-more-conditionals/more-conditionals.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "15. Callbacks",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/15-callbacks/callbacks.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "16. For Each",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/16-for-each/for-each.spec.js"
],
"internalConsoleOptions": "openOnSessionStart"
},
]
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ Whenever you are ready to submit your work, you will need to [commit your work,

## Resources

- Projects: [First Project: Hangman](projects/hangman/ProjectHangman.md) | [Final Project: Document Object Model](projects/final-project/FinalProject.md)
- Installation Guide: [Mac](docs/InstallationGuideMac.md) | [Windows](docs/InstallationGuideWindows.md) | [Linux](docs/InstallationGuideLinuxAndNVM.md)
- JavaScript - [MDN](https://developer.mozilla.org/en-US/) (Unofficial JavaScript Manual) | [Tutorials](https://javascript.info/)
- Command Line: [NPM Guide](https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/) | [Unix Crash Course](https://www.vikingcodeschool.com/web-development-basics/a-command-line-crash-course) | [Unix Cheat Sheet](http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/unix_cheatsheet.html)
- Command Line: [Unix Cheat Sheet](https://www.guru99.com/linux-commands-cheat-sheet.html) | [Unix Tutorial](http://www.ee.surrey.ac.uk/Teaching/Unix/) | [NPM Guide](https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/)
- Git: [Git Commands for Beginners](http://rogerdudler.github.io/git-guide/) | [First Contributions Tutorial](https://github.com/firstcontributions/first-contributions)
- Visual Studio Code: [Mac Keyboard Shortcuts](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf) | [Windows Keyboard Shortcuts](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf) | [Getting Started](https://code.visualstudio.com/docs/getstarted/introvideos)
- Visual Studio Code: [Mac Keyboard Shortcuts](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf) | [Windows Keyboard Shortcuts](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf) | [Getting Started](https://code.visualstudio.com/docs/getstarted/introvideos) | [How to use Quokka.js](https://debug.to/1441/quokka-js-extension-for-visual-studio-code)
18 changes: 0 additions & 18 deletions docs/SubmittingAssignments.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,3 @@ In your terminal (in Visual Studio Code), type:
```
git push origin main
```

## Make A Pull Request

You will then need to make pull request from Github. Here is how you will do that:

1. Open a browser (Chrome, Edge, Safari, Firefox, etc) and go to https://github.com/
2. If you are not signed in, signin
3. In the top right, click on your avatar and select "Your repositories"

![Open your repositories in Github](img/git-your-repositories.png)

4. Select _JSFunFall2022_
5. Click on the "Contribute" dropdown and click on the "Open pull request" button

![Opening a pull request](img/open-pull-request.png)

6. Click on the "Create pull requests" button
7. Give your pull request a title if it does not have one and click on the "Create pull requests" button
15 changes: 15 additions & 0 deletions examples/xss/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Cross-Site Scripting (XSS) Vulnerability Example

This is an example of code that is vulnerable to a [Cross-Site Scripting (XSS)](https://owasp.org/www-community/attacks/xss/) attack.

Open _examples\xss\xss.html_ inside of Chrome, Firefox, Safari, Edge or another web browser. To replicate a XSS vulnerability, insert some HTML with an inline event. The inline event should contain some Javascript that triggers some kind of an attack. Then click on the "Submit" button below.

Here is an example of code that code be used within a client-side XSS attack.

```
<img src="1" onerror="alert('Bad code');">
```

```
<img src="1" onerror="alert(document.querySelector('#password').value)">
```
57 changes: 57 additions & 0 deletions examples/xss/xss.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>My title</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
/>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.0.3/purify.js"
defer
></script>
</head>

<body>
<div class="container mt-2 mb-2">
<h1>Please read the README.md</h1>
<div class="row">
<form class="col col-xs-12 col-md-4">
<label for="text">Enter Text</label>
<input id="text" name="text" type="text" class="form-control mb-2" />
<div>
<span class="mr-2">Display Text</span>
<button id="client-side" class="btn btn-primary" type="button">
Submit
</button>
</div>
</form>
<div class="col col-xs-12 col-md-4">
<label for="password">Password</label>
<input
id="password"
type="password"
class="form-control mb-2"
value="pass1234"
/>
<div>
<button id="capture-password" class="btn btn-secondary">
Submit
</button>
</div>
</div>
</div>
<blockquote id="output" class="blockquote mt-4 mb-4"></blockquote>
</div>

<script>
!(function () {
const text = document.querySelector("#text");
const output = document.querySelector("#output");
document.querySelector("#client-side").addEventListener("click", () => {
output.innerHTML = text.value;
});
})();
</script>
</body>
</html>
1 change: 1 addition & 0 deletions exercises/00-git/IntroductionGit.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
- Michele Edington
- Hal Katzman
- Michelle Waldenmaier
- Andre Price
1 change: 1 addition & 0 deletions exercises/01-variables/01-variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*/

// WRITE YOUR ANSWER BELOW THIS LINE
let myNumber = 9;
1 change: 1 addition & 0 deletions exercises/01-variables/02-variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*/

// WRITE YOUR ANSWER BELOW THIS LINE
let year = 2022;
1 change: 1 addition & 0 deletions exercises/01-variables/03-change-a-variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ let price = 5.99;
*/

// WRITE YOUR ANSWER BELOW THIS LINE
price = 10.0;
1 change: 1 addition & 0 deletions exercises/01-variables/04-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*/

// WRITE YOUR ANSWER BELOW THIS LINE
const PIE = 3.14;
2 changes: 1 addition & 1 deletion exercises/01-variables/05-fix-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// WRITE YOUR ANSWER BELOW THIS LINE

// This is throwing an error. Do you know why?
const numberOfLikes = 57; // Change me
const numberOfLikes = 58; // Change me

// DO NOT CHANGE THE CODE BELOW

Expand Down
2 changes: 1 addition & 1 deletion exercises/01-variables/06-fix-bug.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
document.querySelector("#form").addEventListener("submit", (e) => {
e.preventDefault();

document.querySelector("#name").value; // Change this line only. Set me to a variable called "content".
let content = document.querySelector("#name").value; // Change this line only. Set me to a variable called "content".

// Do not change this
alert("Hello " + content);
Expand Down
7 changes: 7 additions & 0 deletions exercises/02-numbers/01-add.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Create a constant called "sum".
* On the right side of the "equals" sign, there should two numbers and a plus sign.
*/

// WRITE YOUR ANSWER BELOW THIS LINE
const sum = 10 + 6;
10 changes: 10 additions & 0 deletions exercises/02-numbers/02-subtract.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let a = 10; // e.g.
let b = 5; // e.g.

/**
* Create a new variable called "difference". It should equal the "b" minus "a".
* This should still work when "a" and "b" are equal to different numbers.
*/

// WRITE YOUR ANSWER BELOW THIS LINE
let difference = b - a;
9 changes: 9 additions & 0 deletions exercises/02-numbers/03-multiply-and-divide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const ONE_HUNDRED = 100;

/**
* Create a constant called "percentage".
* It should equal one number divided by another, and then multiplied by "ONE_HUNDRED".
*/

// WRITE YOUR ANSWER BELOW THIS LINE
const percentage = (60 - 40) / ONE_HUNDRED;
10 changes: 10 additions & 0 deletions exercises/02-numbers/04-increment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let age = 90; // e.g.

/**
* Increment the variable "age" by 1. (That is, add 1).
* Use the increment operator to solve this problem.
* This should still work when "age" is a different number.
*/

// WRITE YOUR ANSWER BELOW THIS LINE
age++;
10 changes: 10 additions & 0 deletions exercises/02-numbers/05-decrement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let age = 90; // e.g.

/**
* Decrement the variable "age" by 1. (That is, subtract 1).
* Use the decrement operator to solve this problem.
* This should still work when "age" is a different number.
*/

// WRITE YOUR ANSWER BELOW THIS LINE
age--;
8 changes: 8 additions & 0 deletions exercises/02-numbers/06-order-of-operations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Without changing the numbers themselves,
* change the syntax or order of operations so that result equals 800.
*/

// WRITE YOUR ANSWER BELOW THIS LINE

const result = (3 + 5) * 100;
Loading