Skip to content

Conversation

@zainabyahya
Copy link

No description provided.

function isPresentIncluded(presentName, presents) {
//TODO: Add your code here
let presentIncluded = false
let arr = presents.map((present) => {
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.

Instead of using map in this function, you could've used foreach, because you're not aiming to create a new array, you're just checking if the present is there and changing the value of the presentIncluded inside the loop.

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