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

Больше деталей #3

Merged
merged 9 commits into from
Feb 29, 2024

Conversation

Ayronhayd
Copy link
Contributor

@Ayronhayd Ayronhayd commented Feb 25, 2024

@keksobot keksobot changed the title 4.16. Больше деталей Больше деталей Feb 25, 2024
js/main.js Outdated
'Юлия',
'Люпита',
'Вашингтон',
// 8
Copy link
Collaborator

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);
Copy link
Collaborator

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({
Copy link
Collaborator

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`,
Copy link
Collaborator

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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

1 и 25 - магические числа
Ниже по коду такая же ситуация

@keksobot keksobot merged commit 105c99f into htmlacademy-javascript:master Feb 29, 2024
1 check passed
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