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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
node_modules
14 changes: 12 additions & 2 deletions assignments/array-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Scroll to the bottom of the list to use some advanced array methods to help the event director gather some information from the businesses.


const runners = [
{ id: 1, first_name: "Charmain", last_name: "Seiler", email: "cseiler0@wired.com", shirt_size: "2XL", company_name: "Divanoodle", donation: 75 },
{ id: 2, first_name: "Whitaker", last_name: "Ierland", email: "wierland1@angelfire.com", shirt_size: "2XL", company_name: "Wordtune", donation: 148 },
Expand Down Expand Up @@ -58,12 +59,21 @@ const runners = [
// ==== Challenge 1: Use .forEach() ====
// The event director needs both the first and last names of each runner for their running bibs. Combine both the first and last names and populate a new array called `fullNames`. This array will contain just strings.
let fullNames = [];

function fullNames(names) {
return (`${names.first_name} ${names.last_name}`);
}
runners.forEach(function.push(names))
console.log(fullNames);

START HERE
//try this: let firstNamesAllCaps = [];
// runners.forEach(function(runner))
// console.log(firstNamesAllCaps);

// ==== Challenge 2: Use .map() ====
// The event director needs to have all the runners' first names in uppercase because the director BECAME DRUNK WITH POWER. Populate an array called `firstNamesAllCaps`. This array will contain just strings.
let firstNamesAllCaps = [];
console.log(firstNamesAllCaps);


// ==== Challenge 3: Use .filter() ====
// The large shirts won't be available for the event due to an ordering issue. We need a filtered version of the runners array, containing only those runners with large sized shirts so they can choose a different size. This will be an array of objects.
Expand Down
20 changes: 20 additions & 0 deletions assignments/closure.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,27 @@
// that manipulates variables defined in the outer scope.
// The outer scope can be a parent function, or the top level of the script.

// FIRST ATTEMPT
// function unitedStates() {
// const president = "Kid President";
// console.log(`Everybody can be kind, says ${president}`);

// function Oklahoma() {
// const governor = "Kevin Stitt";
// console.log(`Kevin Stitt is a good businessman, says ${president}.`);
// }
// }

let combineName = (function() {
let firstName = "Stephanie";
return function() {
let lastName="Butenhof";
let fullName = firstName + " " + lastName;
return fullName
}
})();

combineName();
/* STRETCH PROBLEMS, Do not attempt until you have completed all previous tasks for today's project files */


Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"eslint": "^6.2.1"
}
}
Loading