Skip to content

Conversation

@abbas-abdalhusain-yosif

No description provided.

function isPresentIncluded(presentName, presents) {
//TODO: Add your code here
console.log("Task-3 :\n");
if(presents.includes(presentName)==true)
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to use an if statement since the includes method already returns a boolean (true or false)

if(a>b)return true;
if(b>a)return false;
}
function sortStudentsAlphabetically(students) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Well done, but we already have a method that sorts the array alphabetically. => (students.sort())

- console.log(odds); // Output: [1, 3, 5, 7, 9]
- console.log(evens); // Output: [2, 4, 6, 8, 10]
**************************************************************/
var array_odd=[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Well done, we mentioned more than once not using (var) because it will result in unexpected behavior sometimes. Please stick to the instructors' instructions

**************************************************************/
function updateGrades(curve, students) {
//TODO: Add your code here
students.map(function(o){
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not correct to mutate (change) the original array because 'map' creates a new array with changed values. We have to use the spread operator. Additionally, the solution misses a small step, which involves subtracting 'curve' from the 'nerds' type.

@ZehraaMA
Copy link
Contributor

I left some comments on some tasks. However, you did a great job at solving each task in your way! Well done 👏🏼

@abbas-abdalhusain-yosif
Copy link
Author

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