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
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ With some basic JavaScript principles in hand, we can now expand our skills out

**Follow these steps to set up and work on your project:**

* [ ] Create a forked copy of this project.
* [ ] Add your project manager as collaborator on Github.
* [ ] Clone your OWN version of the repository (Not Lambda's by mistake!).
* [ ] Create a new branch: git checkout -b `<firstName-lastName>`.
* [ ] Implement the project on your newly created `<firstName-lastName>` branch, committing changes regularly.
* [ ] Push commits: git push origin `<firstName-lastName>`.
* [x] Create a forked copy of this project.
* [x] Add your project manager as collaborator on Github.
* [x] Clone your OWN version of the repository (Not Lambda's by mistake!).
* [x] Create a new branch: git checkout -b `<firstName-lastName>`.
* [x] Implement the project on your newly created `<firstName-lastName>` branch, committing changes regularly.
* [x] Push commits: git push origin `<firstName-lastName>`.

**Follow these steps for completing your project.**

* [ ] Submit a Pull-Request to merge <firstName-lastName> Branch into master (student's Repo). **Please don't merge your own pull request**
* [x] Submit a Pull-Request to merge <firstName-lastName> Branch into master (student's Repo). **Please don't merge your own pull request**
* [ ] Add your project manager as a reviewer on the pull-request
* [ ] Your project manager will count the project as complete by merging the branch back into master.

Expand Down Expand Up @@ -50,4 +50,6 @@ We have learned that closures allow us to access values in scope that have alrea
## Stretch Goals

* [ ] Go back through the stretch problems that you skipped over and complete as many as you can.
* [ ] Look up what an IIFE is in JavaScript and experiment with them
* [ ] Look up what an IIFE is in JavaScript and experiment with them

### Jared Kain
48 changes: 24 additions & 24 deletions assignments/callbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];

/*


//Given this problem:

Expand All @@ -22,34 +22,34 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
console.log(first)
});

*/


function getLength(arr, cb) {
// getLength passes the length of the array into the callback.
}

function last(arr, cb) {
// last passes the last item of the array into the callback.
}
// function getLength(arr, cb) {
// // getLength passes the length of the array into the callback.
// }

// function last(arr, cb) {
// // last passes the last item of the array into the callback.
// }

function sumNums(x, y, cb) {
// sumNums adds two numbers (x, y) and passes the result to the callback.
}
// function sumNums(x, y, cb) {
// // sumNums adds two numbers (x, y) and passes the result to the callback.
// }

function multiplyNums(x, y, cb) {
// multiplyNums multiplies two numbers and passes the result to the callback.
}
// function multiplyNums(x, y, cb) {
// // multiplyNums multiplies two numbers and passes the result to the callback.
// }

function contains(item, list, cb) {
// contains checks if an item is present inside of the given array/list.
// Pass true to the callback if it is, otherwise pass false.
}
// function contains(item, list, cb) {
// // contains checks if an item is present inside of the given array/list.
// // Pass true to the callback if it is, otherwise pass false.
// }

/* STRETCH PROBLEM */
// /* STRETCH PROBLEM */

function removeDuplicates(array, cb) {
// removeDuplicates removes all duplicate values from the given array.
// Pass the duplicate free array to the callback function.
// Do not mutate the original array.
}
// function removeDuplicates(array, cb) {
// // removeDuplicates removes all duplicate values from the given array.
// // Pass the duplicate free array to the callback function.
// // Do not mutate the original array.
// }
24 changes: 24 additions & 0 deletions assignments/closure.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
// ==== Challenge 1: Write your own closure ====
// Write a simple closure of your own creation. Keep it simple!

function house() {
const framing = 'Wood is required, here.'
console.log(`I am the house! ${framing}`);
debugger;

function foundation() {
const concrete = 'But, comprised mainly of concrete.'
console.log(`I am the foundation to the house! ${framing} ${concrete}`);
debugger;

function footing() {
const basePoor = 'Only concrete and rebar are needed!'
const jk = 'Just kidding!'
console.log(`I am the footing to it all! ${framing} ${jk} ${basePoor}`);
debugger;
}//footing

footing();
}//foundation

foundation();
}//house

house();

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

Expand Down