-
Notifications
You must be signed in to change notification settings - Fork 22
array tasks are solved #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| } | ||
| // function findFirstStringStartingWithLetter(letter, strings) { | ||
| // var result = strings.find((value,index) => { | ||
| // return value.startsWith(letter);}) |
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, 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) |
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, 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} |
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 "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) |
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 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);
});
No description provided.