Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simon Ertel [WDFT June 2020 Berlin]#1677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
SiEr0212 wants to merge2 commits intoironhack-labs:masterfromSiEr0212:master

Conversation

SiEr0212
Copy link

@SiEr0212SiEr0212 commentedJun 2, 2020
edited
Loading

Simon Ertel [WDFT June 2020 Berlin]

@SiEr0212SiEr0212 changed the titledoneSimon Ertel [WDFT June 2020 Berlin]Jun 3, 2020
Copy link

@timbotimbertimbotimber left a comment

Choose a reason for hiding this comment

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

Some nice functions here! Happy to discuss any concepts you might not have fully grasped if you'd like though.

SiEr0212 reacted with thumbs up emoji
if (a === b) {
return a || b;
}
}

Choose a reason for hiding this comment

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

sweet. Could refactor it slightly so it's a bit shorter:

function maxOfTwoNumbers(n1, n2) {  if (n1 > n2) {    return n1;  }  return n2;}

SiEr0212 reacted with thumbs up emoji
// return 0;
//}
let sum = 0;
for (i = 0; i < arr.length; i++) {

Choose a reason for hiding this comment

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

You need to declarei so the for loop can run.

SiEr0212 reacted with thumbs up emoji
return sum;

}

Choose a reason for hiding this comment

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

this function completes but it resolves to18miami1truebarca200lisboa810 as it's the same as the one before. We can go through this if you'd like?

SiEr0212 reacted with thumbs up emoji
}



Choose a reason for hiding this comment

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

works when thei is defined. Just make sure to add thelet on line 69

SiEr0212 reacted with thumbs up emoji
return (wordAvg / wordCount);

}

Choose a reason for hiding this comment

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

the best way to attempt this one would be something like...

  • declare a variable for the total
  • create a for loop
  • Add the length of each word within the array to the total (total += wordsArr[i].length;)
  • return the average (total / wordsarr.length)

SiEr0212 reacted with thumbs up emoji
return unique;

}

Choose a reason for hiding this comment

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

nicely done!

return false;

}

Choose a reason for hiding this comment

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

also looks good! Nice one

SiEr0212 reacted with laugh emoji

}


Choose a reason for hiding this comment

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

I can't make this one work as expected. We can go through it if you like? I would have probably:

  • created a variable to check for true or false
  • run a for loop to compare the words in the array to the second argument
  • stop the loop and return the check variable depending on the answer
function doesWordExist(wordsFind, word) {  let check = true;  for (let i = 0; i < wordsFind.length; i++) {    if (wordsFind[i] === word) {      check = true;      break;      could do this with the .include method    }    check = false;  }  return check;}

SiEr0212 reacted with thumbs up emoji
Copy link
Author

@SiEr0212SiEr0212Jun 3, 2020
edited
Loading

Choose a reason for hiding this comment

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

Hey Tim, thanks a lot for your feedback. Was really helpfull.
Yeah didn't declare the i's, thx for the hint. I wondered why it didn't work.
A lot became clearer this morning during the recap of the lab with Jan. I understood the concept of the for of loop and used it in the iterations.

@stale
Copy link

stalebot commentedJul 5, 2020

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.

@stalestalebot added the stale labelJul 5, 2020
@stale
Copy link

stalebot commentedJul 7, 2020

This pull request is closed. Thank you.

@stalestalebot closed thisJul 7, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timbotimbertimbotimbertimbotimber left review comments

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@SiEr0212@timbotimber

[8]ページ先頭

©2009-2025 Movatter.jp