From 10a3829c83145c3f3f7d5aa77b92d4786db9305b Mon Sep 17 00:00:00 2001 From: nickkuep Date: Mon, 28 Nov 2022 20:38:38 -0500 Subject: [PATCH 1/2] complete activity --- 01 - JavaScript Drum Kit/index-START.html | 131 ++++++------ 04 - Array Cardio Day 1/index-START.html | 199 +++++++++++++----- .../index-START.html | 92 ++++---- 3 files changed, 270 insertions(+), 152 deletions(-) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..56bb46d4db 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -1,66 +1,79 @@ - - - JS Drum Kit - - - - - -
-
- A - clap -
-
- S - hihat -
-
- D - kick -
-
- F - openhat -
-
- G - boom + + + JS Drum Kit + + + +
+
+ A + clap +
+
+ S + hihat +
+
+ D + kick +
+
+ F + openhat +
+
+ G + boom +
+
+ H + ride +
+
+ J + snare +
+
+ K + tom +
+
+ L + tink +
-
- H - ride -
-
- J - snare -
-
- K - tom -
-
- L - tink -
-
- - - - - - - - - - - - + + + + + + + + + + + diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 21bec96e8c..4fdb6ee262 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -1,65 +1,164 @@ - - - Array Cardio 💪 - - -

Psst: have a look at the JavaScript Console 💁

- - + const oldest = inventors.sort(function (a, b) { + const lastGuy = a.passed - a.year; + const nextGuy = b.passed - b.year; + return lastGuy > nextGuy ? -1 : 1; + }); + console.table(oldest); + + // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name + // https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris + + //const category = document.querySelector(".mw-category"); + //const links = Array.from(category.querySelectorAll("a")); + //const de = links + // .map((link) => link.textContent) + // .filter((streetName) => streetName.includes("de")); + // 7. sort Exercise + // Sort the people alphabetically by last name + const alpha = people.sort((lastOne, nextOne) => { + const [aLast, aFirst] = lastOne.split(", "); + const [bLast, bFirst] = nextOne.split(", "); + return aLast > bLast ? 1 : -1; + }); + console.log(alpha); + // 8. Reduce Exercise + // Sum up the instances of each of these + const data = [ + "car", + "car", + "truck", + "truck", + "bike", + "walk", + "car", + "van", + "bike", + "walk", + "car", + "van", + "car", + "truck", + ]; + + const transportation = data.reduce(function (obj, item) { + if (!obj[item]) { + obj[item] = 0; + } + obj[item]++; + return obj; + }, {}); + console.log(transportation); + + diff --git a/25 - Event Capture, Propagation, Bubbling and Once/index-START.html b/25 - Event Capture, Propagation, Bubbling and Once/index-START.html index 7bd5931e01..dfbae43367 100644 --- a/25 - Event Capture, Propagation, Bubbling and Once/index-START.html +++ b/25 - Event Capture, Propagation, Bubbling and Once/index-START.html @@ -1,48 +1,54 @@ - - - Understanding JavaScript's Capture - - - -
-
-
+ + + Understanding JavaScript's Capture + + +
+
+
-
- - - - - - + + + + + + From cce04ab03b1950a01a8fb02291c0be7aeef07807 Mon Sep 17 00:00:00 2001 From: nickkuep Date: Mon, 28 Nov 2022 20:57:49 -0500 Subject: [PATCH 2/2] complete activity --- 07 - Array Cardio Day 2/index-START.html | 113 +++++++++++++++-------- 1 file changed, 75 insertions(+), 38 deletions(-) diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index 969566ff78..0e33aa5bb9 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -1,41 +1,78 @@ - - - Array Cardio 💪💪 - - -

Psst: have a look at the JavaScript Console 💁

- - + + + Array Cardio 💪💪 + + +

Psst: have a look at the JavaScript Console 💁

+ +