Skip to content

Conversation

@zainabthabit
Copy link

No description provided.

}
// function findFirstStringStartingWithLetter(letter, strings) {
// var result = strings.find((value,index) => {
// return value.startsWith(letter);})

Choose a reason for hiding this comment

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

Here, you could've added .toLowerCase() to the value to compare the letter and the string without any issues, instead of changing the letter below from h to H.

//TODO: Add your code here
}
// function isPresentIncluded(presentName, presents) {
// return presents.includes(presentName)
Copy link

@AlhassanAli01 AlhassanAli01 Feb 22, 2024

Choose a reason for hiding this comment

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

Here, you're supposed to use the map method to make all the names of the presents lower cased, and then use the includes on the lower cased present.

if (std.type !=="nerd"){
return { ...std, grade:std.grade+curve};
}
else{return std}

Choose a reason for hiding this comment

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

The "nerds" grade should also be changed, their grades should be subtracted with the curve.

function searchReviewers(query, reviewers) {
//TODO: ADD YOUR CODE HERE
return reviewers.filter((reviewers)=>{
return reviewers.reviewerName.includes(query)
Copy link

@AlhassanAli01 AlhassanAli01 Feb 22, 2024

Choose a reason for hiding this comment

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

Here you're supposed to check if the query has anything to do with the reviewerName and description, therefore adding an or operator to include the description is the way to go.

Also adding .toLowercase method to the strings is the best in this scenario.

 return reviewers.filter((reviewer) => {
  let reviewerName = reviewer.reviewerName.toLowerCase();
  let description = reviewer.description.toLowerCase();
  return reviewerName.includes(query) || description.includes(query);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants