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

Update functions-and-arrays.js #1620

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

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.

@@ -1,73 +1,431 @@
// Iteration #1: Find the maximum

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.

// Iteration #3: Calculate the sum

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.