Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

mia-jens-functions and arrays#317

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
jkai7 wants to merge1 commit intoironhack-labs:masterfromjkai7:master

Conversation

jkai7
Copy link

No description provided.

@@ -11,10 +19,27 @@ var words = [
'crackpot'
];

function findLongestWord(wordsArray){

Choose a reason for hiding this comment

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

Nope. You are not supposed to hardcode this find longest word function with something like "foo"?
This function was supposed to find the longest word from a list.

Here is the solution to this part, so you can compare the steps needed:

functionfindLongestWord(wordsArr){varlongest=wordsArr[0];varcandidate;for(vari=1;i<wordsArr.length;i++){candidate=wordsArr[i];if(candidate.length>longest.length){longest=candidate;}}returnlongest;}varlongest=findLongestWord(words);console.log(longest);

// Calculating a Sum

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

function sumArray(){

Choose a reason for hiding this comment

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

Empty Function? You never completed this step. Here is the solution for this step, so you can check it out and make sense of how it works:

// Calculating a SumfunctionsumArray(array){varsum=0;for(varx=0;x<array.length;x++){sum+=array[x];}returnsum;}varnumbers=[6,12,1,18,13,16,2,1,8,10];vartotal=sumArray(numbers);console.log(total);

@ianizaguirre
Copy link

ianizaguirre commentedApr 11, 2018
edited
Loading

You only completed about 20% of this assignment. If you want help understanding how to solve these problems, Slack me, and we can work on them together.

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 freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ianizaguirreianizaguirreianizaguirre left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@jkai7@ianizaguirre

[8]ページ先頭

©2009-2025 Movatter.jp