Skip to content

Commit 01c13ad

Browse files
committed
updated instructions for every JS file
1 parent afae86b commit 01c13ad

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,30 @@ With some basic JavaScript principles in hand, we can now expand our skills out
1515

1616
This task focuses on getting practice with callback functions by giving you an array of values and instructions on what to do with that array.
1717

18-
* [ ] Review the contents of the [callbacks.js](assignments/callbacks.js) file. Notice you are given an array at the top of the page. Use that array to aid you with your callback functions.
18+
* [ ] Review the contents of the [callbacks.js](assignments/callbacks.js) file. Notice you are given an array at the top of the page. Use that array to aid you with your functions.
1919

20-
* [ ] Write out each function using the `ES5` `function` keyword syntax.
21-
22-
* [ ] Solve the problems listed. Save the stretch problems until you have completed Tasks 1-4.
20+
* [ ] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
2321

2422
## Task 3: Array Methods
2523

2624
Use `.forEach()`, `.map()`, `.filter()`, and `.reduce()` to loop over an array with 50 objects in it. The [array-methods.js](assignments/array-methods.js) file contains several challenges built around a fundraising 5K fun run event.
2725

2826
* [ ] Review the contents of the [array-methods.js](assignments/array-methods.js) file.
2927

30-
* [ ] Complete the problems provided to you
28+
* [ ] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
3129

3230
* [ ] Notice the last three problems are up to you to create and solve. This is an awesome opportunity for you to push your critical thinking about array methods, have fun with it.
3331

3432
## Task 4: Closures
3533

36-
We have learned that closures allow us to access values in scope that have already been invoked.
34+
We have learned that closures allow us to access values in scope that have already been invoked (lexical scope).
3735

3836
**Hint: Utilize debugger statements in your code in combination with your developer tools to easily identify closure values.**
3937

4038
* [ ] Review the contents of the [closure.js](assignments/closure.js) file.
41-
* [ ] Solve the problems listed. Save the stretch problems until you have completed Tasks 1-4.
42-
* [ ] Once you have completed this task please submit a pull request against the original fork.
39+
* [ ] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
4340

4441
## Stretch Goals
4542

46-
* [ ] Arrow Function Syntax - [Check out this awesome guide for ES6 arrow syntax](https://medium.freecodecamp.org/when-and-why-you-should-use-es6-arrow-functions-and-when-you-shouldnt-3d851d7f0b26). You will see more and more arrow functions as you progress deeper into JavaScript. Use the [stretch-function-conversion.js](assignments/function-conversion.js) file as a helper challenge to showcase some of the differences between ES5 and ES6 syntax.
47-
43+
* [ ] Go back through the stretch problems that you skipped over and complete as many as you can.
4844
* [ ] Look up what an IIFE is in JavaScript and experiment with them

assignments/array-methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// A local community center is holding a fund rasising 5k fun run and has invited 50 small businesses to make a small donation on their behalf for some much needed updates to their facilities. Each business has assigned a representative to attend the event along with a small donation.
1+
// A local community center is holding a fund raising 5k fun run and has invited 50 small businesses to make a small donation on their behalf for some much needed updates to their facilities. Each business has assigned a representative to attend the event along with a small donation.
22

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

assignments/callbacks.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Create a callback function and invoke the function to test your work. You have been provided an example of a problem and a solution to see how this works with our items array. Study both the problem and the solution to figure out the rest of the problems.
1+
// Create a higher order function and invoke the callback function to test your work. You have been provided an example of a problem and a solution to see how this works with our items array. Study both the problem and the solution to figure out the rest of the problems.
22

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

@@ -11,10 +11,13 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
1111
}
1212
1313
// Potential Solution:
14+
15+
// Higher order function using "cb" as the call back
1416
function firstItem(arr, cb) {
1517
return cb(arr[0]);
1618
}
1719
20+
// Function invocation
1821
firstItem(items, function(first) {
1922
console.log(first)
2023
});

assignments/closure.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Write a simple closure of your own creation. Keep it simple!
33

44

5+
/* STRETCH PROBLEMS, Do not attempt until you have completed all previous tasks for today's project files */
6+
7+
58
// ==== Challenge 2: Create a counter function ====
69
const counter = () => {
710
// Return a function that when invoked increments and returns a counter variable.
@@ -10,8 +13,6 @@ const counter = () => {
1013
// newCounter(); // 1
1114
// newCounter(); // 2
1215

13-
/* STRETCH PROBLEM, Do not attempt until you have completed all previous tasks for today's project files */
14-
1516
// ==== Challenge 3: Create a counter function with an object that can increment and decrement ====
1617
const counterFactory = () => {
1718
// Return an object that has two methods called `increment` and `decrement`.

0 commit comments

Comments
 (0)