Skip to content

resolved tasks - objects#136

Open
marrcelp wants to merge 6 commits intodevmentor-pl:masterfrom
marrcelp:master
Open

resolved tasks - objects#136
marrcelp wants to merge 6 commits intodevmentor-pl:masterfrom
marrcelp:master

Conversation

@marrcelp
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
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 jest parę rzeczy do poprawy :) poza nimi jest ok!

age: 48,
}

console.log(user.firstName, user.lastName, user.sex, user.age); No newline at end of file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

👍

console.log(
calendarJS[date] === null ? `${date} nie zostało wydane` : `${date} wydano w roku ${calendarJS[date]}`
);
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

👍

03/app.js Outdated
}


if (lang === 'en') {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Zdecydowanie mało elastyczne. Co jeśli pojawią się inne języki? Lepsza opcja to if(title[lang]) - jeśli występuje tytuł w danym języki to... np. zwróć :)

03/app.js Outdated
return null;
}

if (translator[lang] === null) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

nie zawsze jest to null domyślnie (bez ustawienia) jest to undefined

03/app.js Outdated
return false;
}

if (lang === 'en') {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Podobnie jak wyżej.

04/app.js Outdated
Comment on lines +23 to +26
return 'Wszystkiego najlepszego z okazji dzisiejszych urodzin!';
}
else {
return 'Dzis nie masz urodzin'
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Lepiej zwrócić true/fasle, a potem zwracać komunikat, bo może być on np. różny - co innego napiszesz babci, co innego dziecku, a jeszcze inaczej partnerce ;)

PS. W szczególności, że nazwa funkcji wskazuje sprawdzenie tak/nie - zamiast konkretnego komunikatu. Oczywiście się czepiam, ale w przyszłości może to być pomocne ;P

Copy link
Copy Markdown
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 jeszcze drobna uwaga :)

return title[lang];
} else {
return title.pl;
return null;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

👍

}

}
if (checkBirthday(user)){
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

👍

}

if (translator[lang] === null) {
if (translator[lang] === null || translator[lang] === undefined) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Tutaj bym uważał. W zadaniu jest jasno napisane, że null więc tylko bym sprawdzał tą wartość.
undefined to co innego - wtedy ma być zwracane null (ostatni warunek, który masz)

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