-
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
Больше деталей #3
Больше деталей #3
Conversation
photoDescription, similarWizards + script connection
js/main.js
Outdated
'Юлия', | ||
'Люпита', | ||
'Вашингтон', | ||
// 8 |
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 generatePhotoId = createRandomIdFromRangeGenerator(1, 25); | ||
const generateId = createRandomIdFromRangeGenerator(1, OBJECT_COUNT); | ||
const commentGenerateId = createRandomIdFromRangeGenerator(1, 9999); |
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.
Функции желательно именовать единообразно commentGenerateId -> generateCommentId
js/main.js
Outdated
}); | ||
|
||
|
||
const similarWizards = () => Array.from({ |
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 commentInformation = () => ({ | ||
id: commentGenerateId(), | ||
url: `img/avatar-${getRandomInteger(1, 6)}.svg`, |
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.
1 и 6 - магические числа. Надо вынести в переменную
Как вариант можно создать объект
const AVATAR_NUMBER = {
min: 1,
max: 6,
}
img/avatar-${getRandomInteger(AVATAR_NUMBER.min, AVATAR_NUMBER.max)}.svg
С остальными магическими числам надо поступить так же
js/main.js
Outdated
}; | ||
}; | ||
|
||
const generatePhotoId = createRandomIdFromRangeGenerator(1, 25); |
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.
1 и 25 - магические числа
Ниже по коду такая же ситуация
-similarWizards -Функции-конструктор
🎓 Больше деталей