Jonas: So after learning all about conditionals
and true false values in JavaScript
it's now time for another coding challenge.
So let's say John and Mike both play basketball
but on different teams.
And in the latest three games,
John's team has scored 89, 120 and 103 points.
And Mike's team has scored 116, 94 and 123 points, okay.
What I want you to do, is calculate the average
score for each team, then decide
which team wins on average, so the one that has
the highest average score and then
print the winner to the console.
And when you print that winner to the console
then also include the average score.
Okay, so we already calculated averages before,
so all we have to do is add up the values
and then divide by three in this case,
because we have three results here, okay.
And then what I also wanted to do,
is to change scores in order to show different winners.
And so here, don't forget to take into account,
that there might be a draw.
So it means that there is the same average score.
And so in your fl statement, you will
have to keep that in mind, okay?
Now after you finish that, you can take it to the next level
and add a little extra.
And in this case, Mary also plays basketball
and her team has scored 97, 134 and 105 points.
And like before, I want you to log the average
winner to the consule.
So what you're gonna have to do here,
is check if one of the players
has a larger score than the other two.
Okay, in order to do that you,
you will probably need the end operator
to take that decision.
Okay, and if you can not solve this one
then it's absolutely no problem.
You can just watch the solution
and see how I do it in there.
Okay, the most important thing is that
you can do these number one two and three.
Okay, and if you wanna take it to the next level
here with the number four, then that's also
a great addition to this challenge, okay.
So take a couple of minutes here,
maybe a half an hour, and try to really complete
this challenge.
And then I'll see you in the next video with a solution.