-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
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.
Неизменную информацию лучше выносить вне функции, тогда память под переменную не будет повторно выделяться
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.
Сейчас везде поддерживается es6, так что используй только const и let
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.
Вот как раз только сегодня увидел информцию про такие объявления переменных
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.
Попробуй писать jsDoc к функциям и там же в комментарии назначение функции - в последствии поможет в поддержке кода
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
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.
Комментарии аналогичны как и для convertHHToRoman
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.
Если ты хочешь получить просто первый символ, то можешь просто timeHM[0]
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.
Удаляй закомментированный код по окончании работы
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.
Для каждой операции используй собственную переменную, так легче ориентироваться в коде
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.
Немного странный цикл, внутри ты проверяешь time[0] Попробуй переписать так, чтобы все проверки были в одном месте, так легче их поддерживать, если появится новое условие
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.
Ты же не часы и минуты конвертируешь, а просто единицы и десятые, так что лучше функции назвать по другому, чтобы они больше отражали, то что ты в них делаешь.
Перевая попытка. Вопросы по TypeError