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

Appearance settings

BCN - Åsa Eriksson #549

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

Bjornhona
Copy link

No description provided.

function maxOfTwoNumbers(num1, num2) {
if (num1 > num2) {
return num1;
} else if (num2 > num1) {
Copy link
Contributor

@tawebbcn tawebbcn Sep 19, 2018

Choose a reason for hiding this comment

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

En este caso, no es necesario la segunda condición. El primer if compara si es mayor, si no lo es significa que el segundo es menor si o si.
El resultado sería el siguiente:

function maxOfTwoNumbers(num1, num2) {
  if (num1 > num2) {
      return num1;
   } else {
      return num2;
   }
}

var avgSum = sumArray(numbersAvg);
if (numbersAvg.length < 1) {
return undefined;
} else return avgSum / numbersAvg.length;
Copy link
Contributor

Choose a reason for hiding this comment

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

 else return avgSum / numbersAvg.length;  -> 
 else {
    return avgSum / numbersAvg.length;
}

@tawebbcn
Copy link
Contributor

Muy bien Åsa, intenta revisar los dos comentarios que te he dejado sobre el código y por lo demás todo correcto 👍

@tawebbcn tawebbcn closed this Sep 19, 2018
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.