Skip to content
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

Функции возвращаются #5

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

furidasha
Copy link
Contributor

@furidasha furidasha commented Dec 16, 2024

@keksobot keksobot changed the title Добавляет тренировочную функцию Функции возвращаются Dec 16, 2024
js/functions.js Outdated

const isDelayAtWork = (starWorkDayTime, endWorkDayTime, startMeetingTime, meetingTimeInMinute) => {
const toNumber = (string) => {
const number = string.split(':');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Деструктуризируй массив const [hours, minutes] = string.split(':');

js/functions.js Outdated
const isDelayAtWork = (starWorkDayTime, endWorkDayTime, startMeetingTime, meetingTimeInMinute) => {
const toNumber = (string) => {
const number = string.split(':');
number[1] /= 60;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не ошибка, но рекомендация. Лучше приводить к минутам, чтоб не работать с числами с плавающей точкой

И здесь можно избежать присваивания, а сразу все делать в return, даже не сохраняя в result

js/data.js Outdated
@@ -50,6 +50,6 @@ const getPhotoData = () => {
];

return { DESCRIPTIONS, NAMES, MESSAGES };
}
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

Убери функцию getPhotoData и экспортируй сразу export { DESCRIPTIONS, NAMES, MESSAGES }. Функция здесь абсолютно лишняя

@keksobot keksobot merged commit d25d1ac into htmlacademy-javascript:master Dec 17, 2024
1 check failed
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.

3 participants