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

[SAO FT2 - DE - W1D3] Marianna Dobal#769

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
mmdobal wants to merge1 commit intoironhack-labs:masterfrommmdobal:master

Conversation

mmdobal
Copy link

No description provided.

thebinaryfelix reacted with thumbs up emoji
var longest=[];
for (let i = 0; i < words.length; i += 1) {
if (longest.length < words[i].length) {
return longest = words[i];

Choose a reason for hiding this comment

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

Não retornar diretamente aqui, primeiro armazenar numa variável qual a maior palavra. Caso contrário, retornará sempre a primeira ocorrência de maior palavra, não vai comparar com todo o array.

} else if (longest.length == words[i].length){
return longest = words[i];
}
}

Choose a reason for hiding this comment

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

Retornar aqui a variável contendo a maior palavra

// Calculate the Average

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

function averageNumbers(numbersAvg) {

Choose a reason for hiding this comment

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

Considerar a possibilidade de array vazio:numbersAvg.length = 0 e também se nenhum valor for passado ao argumento:numbersAvg = undefined

if (wordsUnique[i].indexOf() === - 1){
newArr.push(wordsUnique[i]);
}
else {continue;}

Choose a reason for hiding this comment

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

Linha 97 é desnecessária

for (let i = 0; i < wordsFind.length; i += 1) {
if (wordsFind[i].toLowerCase() === searchWord.toLowerCase()) {
return true;
} else {}

Choose a reason for hiding this comment

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

Se não há condicional noelse ou se for algo comocontinue;, não precisa colocar oelse.

Copy link

@thebinaryfelixthebinaryfelix left a comment

Choose a reason for hiding this comment

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

Boa!

#checked

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@thebinaryfelixthebinaryfelixthebinaryfelix 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
@mmdobal@thebinaryfelix

[8]ページ先頭

©2009-2025 Movatter.jp