Skip to content
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
CodeYourFuture:mainfrom
CYF-Projects:main
Closed

London Class 7 - Kara Howard - JavaScript Core 2 - Week 1#51
kmh256 wants to merge 10 commits into
CodeYourFuture:mainfrom
CYF-Projects:main

Conversation

@kmh256
Copy link
Copy Markdown

@kmh256 kmh256 commented Feb 21, 2021

Your Details

  • Your Name: Kara Howard
  • Your City: London
  • Your Slack Name: Kara Howard

Homework Details

  • Module: JavaScript Core 2
  • Week: 1

Comment thread mandatory/1-writers.js
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.`);
}
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done for using the forEach method and JavaScript string interpolation!

A couple of suggestions for small improvements:

  • Variable naming: the parameter writers of the anonymous function (that is, the function without a name that you're passing to the forEach method) could instead be named writer, in the singular. That's because semantically you are holding the data for only one writer in that variable.
  • The logical expression in the if statement is excluding writers who are 40 years old; you can use the >= comparison operator to include them.

@Jpsi Jpsi added the reviewed A mentor has reviewed this code label Feb 25, 2021
*/

let friendsWithStacie = [];
let friendsWithStacie = people
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work here Kara, good use of higher-order functions.

@github-actions
Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the Stale label May 25, 2021
@github-actions github-actions Bot closed this May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

reviewed A mentor has reviewed this code Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants