-
Notifications
You must be signed in to change notification settings - Fork 256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jim, looks really good. For me the coding examples work better if you have a bit more context, something like, (step 6) https://github.com/HackYourFuture/JavaScript/blob/master/Week7/MAKEME.md . Also can you make sure that at the top there is a list that tells what is in the document?
Week7/REVIEW.md
Outdated
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jim, can we keep this list at the top?
Week7/REVIEW.md
Outdated
@@ -1,9 +1,196 @@ | |||
# REVIEW JavaScript week 7 | |||
|
|||
## Git Workflow | |||
|
|||
To be provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we can add a link to: https://github.com/HackYourFuture/Git/blob/master/Lecture-3.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the workflow is explained there
### Array#filter | ||
|
||
The **filter()** method returns a new array with all elements that pass the test implemented by a user-supplied (predicate\*) function. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can describe a bit more what the function below does, (in a simpler way)
### Array#map\* | ||
|
||
The **map** method returns a new array where each element of the subject array is transformed by a user-supplied transformation (= _mapping_) function. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can describe a bit more what the function below does, (in a simpler way) and with a real life example, something people can actually relate to
const numbers = [3, 5, 2, 7]; | ||
const squares = numbers.map(num => num * num); | ||
console.log(squares); // -> [9, 25, 4, 49] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you say, "here we do the same using the map/filter/reduce method"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you want me to do here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing, it was a compliment!
> The reduce() method applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value\*\*. | ||
|
||
<small>\*\*Although reference is made to a 'single value', this single value may well be an array or an object, as you will see later in the examples below.</small> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above. It would be nice if the coding examples have a bit more context. explanation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes!
const numbers = [3, 5, 2, 7]; | ||
const squares = numbers.map(num => num * num); | ||
console.log(squares); // -> [9, 25, 4, 49] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing, it was a compliment!
Discussion of map, filter and reduce.