Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

shecancode
Copy link

No description provided.

for(var i = 0; i < words.length; i++) {
if(words[i].length > length) {
var length = words[i].length;
Longest = words[i];

Choose a reason for hiding this comment

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

Don't capitalize a variable name. You capitalized "Longest".

};

function averageNumbers (numbers) {
var Average = 0;

Choose a reason for hiding this comment

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

Don't capitalize a variable name. You capitalized "Average".

return total;
};

function averageNumbers (numbers) {

Choose a reason for hiding this comment

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

Your "averageNumbers" function did not work for me when I tried it. Here is one approach you could have done:

// Calculate the Average
function averageNumbers(array) {
  if (array.length === 0) {
    return undefined;
  }
  console.log(sumArray(array), array.length);
  return sumArray(array) / array.length;
}

var numbersAvg = [2, 6, 9, 10, 7, 4, 1, 9];

var average = averageNumbers(numbersAvg);
console.log(average);

@ianizaguirre
Copy link

Try to apply this feedback on your next project.
If you have any questions on my feedback, just send me a message on Slack.
Aside from that, good job and keep up the good work! 😁

Kind Regards,
Ian Izaguirre | Ironhack TA

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