Skip to content

Commit 5130268

Browse files
committed
updates to instructions
1 parent 1f24280 commit 5130268

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

README.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
1-
# JavaScript - II
2-
With some basic JavaScript principles we can now expand our skills out even further by exploring array methods like: `.forEach()`, `.map()`, `.reduce()`, and `.filter()`. We can also look at how closures have a large impact on how we write JavaScript.
31

4-
## Assignment Description
2+
# JavaScript - II
53

6-
* Fork/Clone this repository.
7-
* Complete all the exercises as described inside each assignment file.
8-
* Use `console.log()` statements to check to see if your code does what it is supposed to do.
9-
* To test your `console` statements you can run `node /assignments/<fileName>` and see what prints in your terminal. You can also use an online tool like `JSBin`, `REPL.it`, `JSFiddle`, or even your `Chrome developer console`.
10-
* Once you finish the exercises in each file, commit your code, and push it to your fork.
4+
With some basic JavaScript principles in hand, we can now expand our skills out even further by exploring callback functions, array methods, and closure. Finish each task in order as the concepts build on one another.
115

12-
### Callbacks
6+
### Task 1: Set Up The Project With Git
7+
* [ ] Fork the project into your GitHub user account
8+
* [ ] Clone the forked project into a directory on your machine
9+
* [ ] You are now ready to build this project with your preferred IDE
10+
* [ ] Use `console.log()` statements to check your work.
1311

14-
* In the [callbacks.js](assignments/callbacks.js) file you'll be receiving a lot of practice on how to use callbacks to pass around data.
15-
* Write out each function using the `ES5` `function` keyword syntax.
16-
* Remember that a callback function is simply a function that is being passed around to other functions.
17-
* **Stretch Problem** After you're done with all of the functions, go ahead and re-factor all of them to use `ES6` `Arrow Functions`
12+
### Task 2: Callbacks
13+
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.
14+
* [ ] 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. **Remember that a callback function is a function that is being passed around to other functions.**
15+
* [ ] Write out each function using the `ES5` `function` keyword syntax.
16+
* [ ] Solve the problems listed. Save the stretch problems until you have completed Tasks 1-4.
1817

19-
### Function Conversion
20-
You will see more and more arrow functions as you progress deeper into JavaScript. Use the [function-conversion.js](assignments/function-conversion.js) file as a helper challenge to showcase some of the differences between ES5 and ES6 syntax.
2118

22-
### Array Methods
19+
### Task 3: Array Methods
2320
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.
21+
* [ ] Review the contents of the [array-methods.js](assignments/array-methods.js) file.
22+
* [ ] Complete the problems provided to you
23+
* [ ] 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.
24+
25+
### Task 4: Closures
26+
We have learned that closures allow us to access values in scope that have already been invoked.
27+
28+
**Hint: Utilize debugger statements in your code in combination with your developer tools to easily identify closure values.**
29+
30+
* [ ] Review the contents of the [closure.js](assignments/array-methods.js) file.
31+
* [ ] Solve the problems listed. Save the stretch problems until you have completed Tasks 1-4.
32+
* [ ] Once you have completed this task please submit a pull request against the original fork.
33+
34+
## Stretch Goals
2435

25-
* Read the instructions found within the file carefully to finish the challenges.
26-
* The last challenge is to come up with 3 problems to solve and then build a solution for them using any of the array methods listed above.
27-
* Share one of your favorite problem/solutions in your team meeting.
28-
* Complete each challenge presented before moving on to closure.
36+
2937

30-
### Closures
31-
The [closure.js](assignments/closure.js) assignment showcases how variables can be used outside of functions to store state using closure.
38+
* [ ] Arrow Function Syntax - You will see more and more arrow functions as you progress deeper into JavaScript. Use the [function-conversion.js](assignments/function-conversion.js) file as a helper challenge to showcase some of the differences between ES5 and ES6 syntax
3239

33-
* Complete each challenge.
40+
* [ ] Look up what an IIFE is in JavaScript and experiment with them

assignments/closure.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const counter = () => {
1010
// newCounter(); // 1
1111
// newCounter(); // 2
1212

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

1415
// ==== Challenge 3: Create a counter function with an object that can increment and decrement ====
1516
const counterFactory = () => {

assignments/function-conversion.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
// };
1212
// add(1,2);
1313

14-
let subtract = function (param1, param2) {
15-
return param1 - param2;
16-
};
17-
subtract(1,2); //?
14+
// let subtract = function (param1, param2) {
15+
// return param1 - param2;
16+
// };
17+
// subtract(1,2);
1818

19-
exampleArray = [1,2,3,4];
19+
// exampleArray = [1,2,3,4];
2020
// const triple = exampleArray.map(function (num) {
2121
// return num * 3;
2222
// });

0 commit comments

Comments
 (0)