Skip to content
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

Merged

Conversation

skyfxllen
Copy link
Contributor

@skyfxllen skyfxllen commented Nov 27, 2024

@keksobot keksobot changed the title task4 Больше деталей Nov 27, 2024
keksobot pushed a commit that referenced this pull request Nov 30, 2024
@keksobot
Copy link
Contributor

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

js/main.js Outdated
@@ -0,0 +1,62 @@
function takeARandomNumber(max, min = 0){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Обычно когда функция что-то получает, ее начинают с глагола get. Это правило можно применять почти всегда)

Copy link
Contributor Author

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 = [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Константы лучше вынести. Дальше будет задание на модули и их можно вообще в отдельный файл унести

Copy link
Contributor Author

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)],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если нужно будет 3 или больше комментов добавить, то что делать?)

Copy link
Contributor Author

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}`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.jpg не хватает

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

добавил

@keksobot
Copy link
Contributor

keksobot commented Dec 2, 2024

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Dec 2, 2024
@Danila100
Copy link

PR принят, все ок! 🙂

@keksobot keksobot merged commit a28cc1f into htmlacademy-univer-javascript-1:master Dec 2, 2024
1 check passed
@Danila100
Copy link

Можно делать деление на модули 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants