Skip to content

Comments

Raghad Alobaid & Abdullah AlKhareji#5

Open
rfo97 wants to merge 1 commit intoJoinCODED:mainfrom
rfo97:main
Open

Raghad Alobaid & Abdullah AlKhareji#5
rfo97 wants to merge 1 commit intoJoinCODED:mainfrom
rfo97:main

Conversation

@rfo97
Copy link

@rfo97 rfo97 commented Mar 10, 2025

No description provided.

if(numbers.length%2 == 0){
return false;
}
return true; // replace false with what you see is fit
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just return the result of the condition:

function isArrayLengthOdd(numbers: number[]): boolean {
  return numbers.length%2 === 0;
}

Also, please use ===


if(numbers.length%2 == 0){
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the function you already have:

function isArrayLengthEven(numbers: number[]): boolean {
  return !isArrayLengthOdd(numbers);
}

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