Skip to content

Conversation

RicardVillalba
Copy link

is not finished yet, I'm on it (6 and 7 don work). I dit the pull request just in case.


var maxOfTwoNumbers = [5, 7];

function findMax(array) {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • The function should have two separate arguments, not an array as an argument.
  • The function is named incorrectly and is not logging the result if the second number is highest.

I don't fully understand:
You can use rest parameter (...) syntax
allows us to represent an indefinite number of arguments as an array.*/
function findLongestWord(...strs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • This function is spreading an array that is getting from a callback. This was not how it was asked in the instructions.


const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10];

var sumNumbers = numbers.reduce(function(a, b) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have been a function as instructed in the repo.

// Iteration #4: Calculate the average
// Level 1: Array of numbers
const numbersAvg = [2, 6, 9, 10, 7, 4, 1, 9];
var sumNumbers = numbersAvg.reduce(function(a, b) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have been a function as instructed in the repo.

"palace"
];
// I'm not sure about this
averageWordLength = wordsArr.join("").length / wordsArr.length;
Copy link
Contributor

Choose a reason for hiding this comment

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

variable is not declared. Also, this should have been a function as instructed in the repo.

@RicardVillalba
Copy link
Author

RicardVillalba commented Apr 1, 2020 via email

"disobedience"
];
var x = ["machine"];
function doesWordExist(wordsFind, x) {
Copy link
Contributor

Choose a reason for hiding this comment

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

function is not returning anything.

@tawebbcn
Copy link
Contributor

tawebbcn commented Apr 1, 2020

Some of the Iterations show results that match the asked solution, however, neither the instructions in the repo nor the Jasmine testing were followed properly. It is good that you used more advanced methods like .includes, .sort and .reduce. However, the Lab was about using the resources seen in the lectures. Overall there is good use of logic in the code but for next Labs try to follow instructions correctly and ask us for help if you don't understand something.

@tawebbcn tawebbcn closed this Apr 1, 2020
@RicardVillalba
Copy link
Author

RicardVillalba commented Apr 1, 2020 via email

@RicardVillalba
Copy link
Author

RicardVillalba commented Apr 1, 2020 via email

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