-
Notifications
You must be signed in to change notification settings - Fork 1
Функции возвращаются #6
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
Функции возвращаются #6
Conversation
|
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
js/functions.js
Outdated
| }; | ||
| const getTimeConv = (time) => { | ||
| const timelist = time.split(':'); | ||
| const finalResult = Number(timelist[0]) * 60 + Number(timelist[1]); |
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.
"финальный результат" - это очень абстрактно. Эта функция возвращает что очень конкретное, но название функции и результата скрывают это.
Что вернет функция?
js/functions.js
Outdated
| const isWorkTime = (startDate, endDate, startMeet, durationMeet) =>{ | ||
| const duration = durationMeet + getTimeConv(startMeet); | ||
| if(getTimeConv(startDate) <= duration && duration <= getTimeConv(endDate)){ | ||
| return true; |
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 getTimeConv(startDate) <= duration && duration <= getTimeConv(endDate);
js/functions.js
Outdated
| //console.log(getTimeConv('00:01')); | ||
|
|
||
| const isWorkTime = (startDate, endDate, startMeet, durationMeet) =>{ | ||
| const duration = durationMeet + getTimeConv(startMeet); |
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.
скорее всего, это не "продолжительность". Начало встречи + продолжительность = окончание встречи (в минутах, так как выполнена конвертация)
🎓 Функции возвращаются
💥 https://htmlacademy-javascript.github.io/2607777-kekstagram-2/6/