Skip to content

Conversation

maandysi
Copy link

Google is my best friend. Had some troubles with mixed arrays but learned a lot.

/_/\
( o o )
==**==
/ \

Copy link

@TA-Remote TA-Remote left a comment

Choose a reason for hiding this comment

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

  • Good work, keep practicing
  • Pay attention to the indentation of your code, as that will help you if you need to go back and for others to also understand your code easier

let newArray = [];
for (i=0; i<array.length; i++){
if (array.indexOf(array[i])=== -1){

Choose a reason for hiding this comment

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

You want to check if the word already exists in the newArray, not in the array that you're receiving

Suggested change
if (array.indexOf(array[i])=== -1){
if (newArray.indexOf(array[i])=== -1){

@stale
Copy link

stale bot commented Jun 18, 2023

This pull request has been automatically marked as stale because it didn't have any recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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