Skip to content

Hw7 #12

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Hw7 #12

wants to merge 13 commits into from

Conversation

NosovDima
Copy link
Owner

Добрый день. ДЗ сделал, есть вопросы в комментариях

alert(arr);
}
});
// можно ли сделать одну функцию для всего массива?
Copy link

Choose a reason for hiding this comment

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

да объяви функцию


function searchStart(arr, subString) {
   тут пиши весь код
}

hw7script.js Outdated
building: ["Дом", "Банк", "Больница", "Театр"],
};
const search = "ко";
arr.forEach((arr) => {
Copy link

Choose a reason for hiding this comment

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

никогда не переназначай имя которые у тебя уже используются

arr.forEach((item) => {

к тому же arr это ведь не массив, у него нет forEach

hw7script.js Outdated
alert(str.toLocaleUpperCase());
// Exrecise 2
function searchStart(arr, subString) {
const arr = {
Copy link

Choose a reason for hiding this comment

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

тебе не нужен этот объект, у тебя все что нужно передается аргументами, используй их

hw7script.js Outdated
product: ["яблоко", "груша", "гриб", "огурец"],
building: ["Дом", "Банк", "Больница", "Театр"],
};
const search = "ко";
Copy link

Choose a reason for hiding this comment

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

у тебя это аргумент subString

}
// Как сделать с prompt?
};
alert(evenNum(7));
Copy link

Choose a reason for hiding this comment

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

alert(evenNum(prompt('введите число')));

}
});
return null;
Copy link

Choose a reason for hiding this comment

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

возваращай arr

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.

2 participants