-
Notifications
You must be signed in to change notification settings - Fork 70
Conversation
honest-hrundel
commented
Nov 2, 2016
🍅 Пройдено тестов 10 из 15
honest-hrundel
commented
Nov 2, 2016
🍅 Пройдено тестов 10 из 15
sortby
honest-hrundel
commented
Nov 2, 2016
🍅 Пройдено тестов 14 из 15
honest-hrundel
commented
Nov 2, 2016
🍅 Пройдено тестов 14 из 15
format
honest-hrundel
commented
Nov 2, 2016
🍅 Пройдено тестов 14 из 15
honest-hrundel
commented
Nov 2, 2016
🍅 Пройдено тестов 14 из 15
honest-hrundel
commented
Nov 2, 2016
🍅 Пройдено тестов 14 из 15
laaaast check
honest-hrundel
commented
Nov 2, 2016
🍅 Пройдено тестов 10 из 15
honest-hrundel
commented
Nov 2, 2016
🍏 Пройдено тестов 15 из 15
onufrienko
commented
Nov 3, 2016
Привет! :) Я посмотрю твой пр сегодня вечером либо завтра, не теряй меня, если что.
Uliana1997
commented
Nov 3, 2016
Хорошо)
Отправлено с iPhone
3 нояб. 2016 г., в 11:29, Ekaterina Onufrienko notifications@github.com написал(а):
Привет! :) Я посмотрю твой пр сегодня вечером либо завтра, не теряй меня, если что.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
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.
fields или все же functions?
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.
Эту функцию можно сильно сократить, возвращая, например, x - y
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.
Копипаст
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.
попробуй метод filter
onufrienko
commented
Nov 4, 2016
🍅
honest-hrundel
commented
Nov 6, 2016
🍏 Пройдено тестов 15 из 15
honest-hrundel
commented
Nov 6, 2016
🍏 Пройдено тестов 15 из 15
Uliana1997
commented
Nov 6, 2016
🍏
onufrienko
commented
Nov 8, 2016
🚀
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.
мне с ними было неудобно, тут маленький код и так было понятно( мне их вернуть назад??
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.
Их же можно сворачивать в IDE :) В данном случае, да маленький, но стоит привыкать с ним работать. Писать *doc – хороший тон.
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.
Не старайся усложнять там, где всё можно сделать проще. Когда функция сортировки достаточно простая, не стоит выносить её в отдельную функцию. К тому же её можно написать сильно короче и проще:
functions.sort(function (a, b) { return priority[a.name] - priority[b.name]; });
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.
func стоит переименовать. Нейминг в данном случае ничего не говорит.
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.
Смотри, ты здесь создаёшь массив, бегаешь в цикле, пушишь в результирующий массив. Всё это делает Array.reduce() (MDN), только более красиво.
Посмотри в его сторону. Это то, что тебе здесь нужно.
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.
👍
Супер! Спасибо
evilj0e
commented
Nov 9, 2016
🍅
honest-hrundel
commented
Nov 10, 2016
🍅 Не пройден линтинг или базовые тесты
honest-hrundel
commented
Nov 10, 2016
🍏 Пройдено тестов 15 из 15
Uliana1997
commented
Nov 10, 2016
🍏
Uliana1997
commented
Nov 10, 2016
Только я не знаю как заменить reduce, то что вы описываете делает вроде map, то есть мы создаем новый массив вызывая функцию в нем
А reduce применяет функцию и сводит к одному значению, или я не так что то понимаю??
evilj0e
commented
Nov 10, 2016
Итоговым значением может же быть и массив. Вот, прочитай, тут про reduce.
honest-hrundel
commented
Nov 10, 2016
🍏 Пройдено тестов 15 из 15
Uliana1997
commented
Nov 10, 2016
🍏
Uliana1997
commented
Nov 10, 2016
исправила все замечания
evilj0e
commented
Nov 11, 2016
Ульяна, не все комментарии учтены.
🍅
honest-hrundel
commented
Nov 12, 2016
🍅 Не пройден линтинг или базовые тесты
honest-hrundel
commented
Nov 12, 2016
🍏 Пройдено тестов 15 из 15
Uliana1997
commented
Nov 12, 2016
🍏
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.
Метод sort – не чистая функция. Только что ты мутировала коллекцию. Требования задания не учтены.
evilj0e
commented
Nov 15, 2016
🍅
evilj0e
commented
Nov 24, 2016
⬆️ @Uliana1997
No description provided.