-
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
Больше деталей #4
Больше деталей #4
Conversation
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
js/main.js
Outdated
@@ -0,0 +1,62 @@ | |||
function takeARandomNumber(max, min = 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.
Обычно когда функция что-то получает, ее начинают с глагола get
. Это правило можно применять почти всегда)
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/main.js
Outdated
} | ||
|
||
function createArrayOfComments(){ | ||
const comments = [ |
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.
Сейчас вынес из функций, дальше распределю
js/main.js
Outdated
const newComment = { | ||
id: i + 1, | ||
avatar: `img/avatar-${takeARandomNumber(6, 1)}.svg`, | ||
message: takeARandomNumber(2,1) > 1 ? `${comments[takeARandomNumber(comments.length)]}/n${comments[takeARandomNumber(comments.length)]}` : comments[takeARandomNumber(comments.length)], |
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.
Если нужно будет 3 или больше комментов добавить, то что делать?)
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/main.js
Outdated
for (let i = 0; i < 25; i++){ | ||
const newPhoto = { | ||
id : i + 1, | ||
url: `photos/${i + 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.
.jpg не хватает
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.
добавил
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
PR принят, все ок! 🙂 |
a28cc1f
into
htmlacademy-univer-javascript-1:master
Можно делать деление на модули 😉 |
🎓 Больше деталей
💥 https://htmlacademy-univer-javascript-1.github.io/2579201-kekstagram-5/4/