This repository was archived by the owner on Jan 3, 2023. It is now read-only.
London Class 7 - Kara Howard - JavaScript Core 2 - Week 1#51
Closed
kmh256 wants to merge 10 commits into
Closed
Conversation
Jpsi
reviewed
Feb 25, 2021
Comment on lines
+74
to
+78
| writers.forEach(function (writers) { | ||
| if (writers.age > 40 && writers.age < 49 && writers.alive === false) { | ||
| console.log(`Writer ${writers.firstName} ${writers.lastName} died at ${writers.age} years old.`); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Well done for using the forEach method and JavaScript string interpolation!
A couple of suggestions for small improvements:
- Variable naming: the parameter
writersof the anonymous function (that is, the function without a name that you're passing to theforEachmethod) could instead be namedwriter, in the singular. That's because semantically you are holding the data for only one writer in that variable. - The logical expression in the
ifstatement is excluding writers who are 40 years old; you can use the>=comparison operator to include them.
11ma
reviewed
Apr 12, 2021
| */ | ||
|
|
||
| let friendsWithStacie = []; | ||
| let friendsWithStacie = people |
There was a problem hiding this comment.
Excellent work here Kara, good use of higher-order functions.
|
Your coursework submission has been closed because nobody has interacted with it in six weeks. You are welcome to re-open it to get more feedback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Your Details
Homework Details