Skip to content

Conversation

@amythetester
Copy link

No description provided.

@JansenMartin
Copy link

Great use of an if-elsif-else statement and complex conditionals! I like how you implemented the "or" operator in line 6. (Normally I shy away from using so many in a row, but it makes sense since you've already checked to make sure BOTH aren't nil). Nice job! :)

@shrutivanw
Copy link
Collaborator

Nice work! 👍

return true
elsif array1 == nil || array2 == nil || array1.count != array2.count
return false
else

Choose a reason for hiding this comment

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

You do not need this else. If you have not returned in line 4 or line 7, you will hit this line.

elsif array1 == nil || array2 == nil || array1.count != array2.count
return false
else
i = 0

Choose a reason for hiding this comment

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

You don't need to initialize i to 0 since you do that in line 10.

Copy link

@sloekito sloekito left a comment

Choose a reason for hiding this comment

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

Great work! Very small suggestions for cleaner code.

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.

4 participants