-
Notifications
You must be signed in to change notification settings - Fork 1
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
Функции возвращаются #5
Conversation
js/functions.js
Outdated
|
||
const isDelayAtWork = (starWorkDayTime, endWorkDayTime, startMeetingTime, meetingTimeInMinute) => { | ||
const toNumber = (string) => { | ||
const number = string.split(':'); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 }; | |||
} | |||
}; | |||
|
There was a problem hiding this comment.
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 }. Функция здесь абсолютно лишняя
🎓 Функции возвращаются