Skip to content

[PTREMOTEES] Naiim Taefy #3840

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

NaiimTaefy
Copy link

No description provided.

sum += number.length;
break;
case "object":
case "array":

Choose a reason for hiding this comment

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

Suggested change
case "array":

Entiendo que lo hayas puesto pero si sacas por consola el typeof de un array te dira que es un object, cositas de javascript que estan "mal" jejejeje

Comment on lines +64 to +68
let sum = 0;
for (const number of numbers) {
sum += number;
}
const result = numbers.length > 0 ? sum / numbers.length : null;

Choose a reason for hiding this comment

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

Suggested change
let sum = 0;
for (const number of numbers) {
sum += number;
}
const result = numbers.length > 0 ? sum / numbers.length : null;
const result = numbers.length > 0 ? sum(numbers) / numbers.length : null;

Aplicando lo que has puesto esto seria interesante no?, así te ahorras poner el bucle que ya esta puesto en otro lado! :D

Comment on lines +87 to +91
let sum = 0;
for (const word of wordsArr) {
sum += word.length;
}
const result = wordsArr.length > 0 ? sum / wordsArr.length : null;

Choose a reason for hiding this comment

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

Suggested change
let sum = 0;
for (const word of wordsArr) {
sum += word.length;
}
const result = wordsArr.length > 0 ? sum / wordsArr.length : null;
const result = wordsArr.length > 0 ? sum(wordsArr) / wordsArr.length : null;

Mas de lo mismo no?

Comment on lines +97 to +106
let sum = 0;
for (const mixArr of mixArrs) {
if (typeof mixArr === "string") {
// sum += !Number.isNaN(Number(mixArr)) ? Number(mixArr) : mixArr.length;
sum += mixArr.length;
} else {
sum += Number(mixArr);
}
}
const result = mixArrs.length > 0 ? sum / mixArrs.length : null;

Choose a reason for hiding this comment

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

Suggested change
let sum = 0;
for (const mixArr of mixArrs) {
if (typeof mixArr === "string") {
// sum += !Number.isNaN(Number(mixArr)) ? Number(mixArr) : mixArr.length;
sum += mixArr.length;
} else {
sum += Number(mixArr);
}
}
const result = mixArrs.length > 0 ? sum / mixArrs.length : null;
const result = mixArrs.length > 0 ? sum(mixArrs) / mixArrs.length : null;

And again and again... :D

@CrisArranz
Copy link

Naaah!! perfecto tio de verdad super bien hecho y encima haciendo el de la matriz que es complejo, bien bien!!! sigue asi!!

@stale
Copy link

stale bot commented Jul 15, 2023

This pull request has been automatically marked as stale because it didn't have any recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants