Skip to content

Conversation

@marrcelp
Copy link

No description provided.

Copy link
Owner

@devmentor-pl devmentor-pl left a comment

Choose a reason for hiding this comment

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

Marcelu,

Tutaj również parę drobnych uwag :)

console.log(performAction(a, b, '-'));
console.log(performAction(a, b, '*'));
console.log(performAction(a, b, '/'));
console.log(performAction(a, b, '%'));
Copy link
Owner

Choose a reason for hiding this comment

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

👍

02/app.js Outdated
alert('Wartość powinna mieścić się w przedziale 1-9! Podaj cyfrę!');
location.reload();
} else if (n == 0) {
console.log(`${a}^${n} = 1`);
Copy link
Owner

Choose a reason for hiding this comment

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

Forma zapisu miała być inna ;) Obecna jest dużo łatwiejsza ;P spróbuj osiągnąć efekt jak w zadaniu ;)

03/app.js Outdated
Comment on lines 22 to 27
} else if (a < b && a < c){
return parseInt(b) + parseInt(c);

} else if (a < b && a >c){
return parseInt(a) + parseInt(b);
}
Copy link
Owner

Choose a reason for hiding this comment

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

Jeśli wiemy, że a nie jest największa to wiemy, że b i c jest - nie trzeba ponownie tego sprawdzać ;)

PS. Najłatwiej by było zrobić z tych liczb tablicę i posortować ;)

const isSumEven = isEven(sum);
console.log(isSumEven);

showInfo(sum, isSumEven);
Copy link
Owner

Choose a reason for hiding this comment

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

👍

04/app.js Outdated
Comment on lines 6 to 7
const randomNumber = Math.round((Math.random() * (max - min)) + min);
array.push(randomNumber);
Copy link
Owner

Choose a reason for hiding this comment

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

Uwaga na dostępy od lewej krawędzi ;)

04/app.js Outdated
}

function getAvg(array){
const sum = array.reduce((acc, element) => acc + element);
Copy link
Owner

Choose a reason for hiding this comment

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

Uwaga na pustą tablicę - warto dodać drugi parametr do reduce()

const avg = student.getAverageGrade();
console.log(avg);

console.log(student); No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

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

👍

Copy link
Owner

@devmentor-pl devmentor-pl left a comment

Choose a reason for hiding this comment

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

Marcelu,

Jest ok, z drobną uwagą ;)

i++;
} else if (n == 0) {
console.log(`${a}^${n} = 1`);
//zostawilem w tym przypadku zapis a^n, poniewaz a^0 = 1, ciezko to inaczej zapisac
Copy link
Owner

Choose a reason for hiding this comment

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

👍


let i = 1;
let sum = a;
let equation = `${a}`
Copy link
Owner

Choose a reason for hiding this comment

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

Można po prostu zapisać let equation = a

i++;
}

console.log(`${equation} = ${sum}`);
Copy link
Owner

Choose a reason for hiding this comment

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

👍

const sortedArray = array.sort((a ,b) => b - a);
const arrayWith2Elements = sortedArray.slice(0, 2);
const sum = arrayWith2Elements.reduce((acc, el) => acc + el, 0);
return sum;
Copy link
Owner

Choose a reason for hiding this comment

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

👍

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