+
K
- tom
+ tom
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/01 - JavaScript Drum Kit/index.html b/01 - JavaScript Drum Kit/index.html
old mode 100644
new mode 100755
diff --git a/01 - JavaScript Drum Kit/style.css b/01 - JavaScript Drum Kit/style.css
old mode 100644
new mode 100755
diff --git a/02 - JS + CSS Clock/index-FINISHED.html b/02 - JS + CSS Clock/index-FINISHED.html
old mode 100644
new mode 100755
diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html
old mode 100644
new mode 100755
index 2712384201..28bb102015
--- a/02 - JS + CSS Clock/index-START.html
+++ b/02 - JS + CSS Clock/index-START.html
@@ -61,13 +61,36 @@
background:black;
position: absolute;
top:50%;
+ transform-origin: 100%;
+ transform: rotate(90deg);
+ transition: all 0.05s;
+ transition-timing-function: cubic-bezier(0.1, 2.7, 0.56, 1)
}
diff --git a/02 - JS + CSS Clock/index.html b/02 - JS + CSS Clock/index.html
old mode 100644
new mode 100755
diff --git a/03 - CSS Variables/index-FINISHED.html b/03 - CSS Variables/index-FINISHED.html
old mode 100644
new mode 100755
diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html
old mode 100644
new mode 100755
index bf0f33e3ba..70a4934b1e
--- a/03 - CSS Variables/index-START.html
+++ b/03 - CSS Variables/index-START.html
@@ -21,6 +21,21 @@
Update CSS Variables with JS

diff --git a/04 - Array Cardio Day 1/index-FINISHED.html b/04 - Array Cardio Day 1/index-FINISHED.html
old mode 100644
new mode 100755
diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html
old mode 100644
new mode 100755
index 6e28e357d0..b7e2ba8971
--- a/04 - Array Cardio Day 1/index-START.html
+++ b/04 - Array Cardio Day 1/index-START.html
@@ -27,28 +27,62 @@
// Array.prototype.filter()
// 1. Filter the list of inventors for those who were born in the 1500's
+ const bornInThe1500s = inventors.filter(inventor => inventor.year >= 1500 && inventor.year < 1600)
+ console.table(bornInThe1500s)
// Array.prototype.map()
// 2. Give us an array of the inventory first and last names
+ const inventorNames = inventors.map(inventor => `${inventor.first} ${inventor.last}`)
+ console.log(inventorNames)
// Array.prototype.sort()
// 3. Sort the inventors by birthdate, oldest to youngest
+ const oldestToYoungest = inventors.sort((inventorA, inventorB) => inventorA.year > inventorB.year ? 1 : -1)
+ console.table(oldestToYoungest)
// Array.prototype.reduce()
// 4. How many years did all the inventors live?
+ const totalYearsLived = inventors.reduce((total, inventor) => {
+ return total + (inventor.passed - inventor.year)
+ }, 0)
+ console.log(totalYearsLived)
// 5. Sort the inventors by years lived
+ const yearsLived = inventor => inventor.passed - inventor.year
+ const sortedYearsLived = inventors.sort((inventorA, inventorB) => yearsLived(inventorA) > yearsLived(inventorB) ? 1 : -1)
+ console.table(sortedYearsLived)
// 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')) // could also do with spread [...NodeList]
+ //
+ // const de = links
+ // .map(link => link.textContent)
+ // .filter(streetName => streetName.includes('de'))
+ // Have to run in console on wikipedia page
// 7. sort Exercise
// Sort the people alphabetically by last name
+ const sortedAlphabetically = people.sort((previous, next) => {
+ const [previousLast, previousFirst] = previous.split(', ')
+ const [nextLast, nextFirst] = next.split(', ')
+ return previousLast > nextLast ? 1 : -1
+ })
+ console.log(sortedAlphabetically)
// 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 sumUpInstances = data.reduce((object, item) => {
+ if (!object[item]) {
+ object[item] = 0
+ }
+ object[item]++
+ return object
+ }, {})
+ console.log(sumUpInstances)