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

Нужно больше функций #2

Merged
merged 4 commits into from
Sep 17, 2024

Conversation

KateSolodchuk
Copy link
Contributor

@KateSolodchuk KateSolodchuk commented Sep 16, 2024

@keksobot keksobot changed the title Module2 task1 Нужно больше функций Sep 16, 2024
@keksobot
Copy link
Contributor

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

keksobot pushed a commit that referenced this pull request Sep 16, 2024
@@ -0,0 +1,22 @@
function checkStringLength (string, maxLength) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

используем стрелочные функции по максимуму

function checkStringLength (string, maxLength) {
const currentLength = string.length;

if (currentLength <= maxLength) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

излишнее удлинение кода
можно сразу вернуть результат тут

newString += currentSymbol;
}

return(newString === normalizedString);
Copy link
Collaborator

Choose a reason for hiding this comment

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

скобки в данном случае не нужны, но точно нужен пробел

let newString = '';
const currentLength = normalizedString.length;

for (let currentIndex = currentLength - 1; currentIndex >= 0; currentIndex--) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

хочу разворот "методов массива"

@keksobot keksobot merged commit 3423586 into htmlacademy-javascript:master Sep 17, 2024
1 check failed
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