-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
alert(arr); | ||
} | ||
}); | ||
// можно ли сделать одну функцию для всего массива? |
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.
да объяви функцию
function searchStart(arr, subString) {
тут пиши весь код
}
hw7script.js
Outdated
building: ["Дом", "Банк", "Больница", "Театр"], | ||
}; | ||
const search = "ко"; | ||
arr.forEach((arr) => { |
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.
никогда не переназначай имя которые у тебя уже используются
arr.forEach((item) => {
к тому же arr это ведь не массив, у него нет forEach
hw7script.js
Outdated
alert(str.toLocaleUpperCase()); | ||
// Exrecise 2 | ||
function searchStart(arr, subString) { | ||
const arr = { |
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.
тебе не нужен этот объект, у тебя все что нужно передается аргументами, используй их
hw7script.js
Outdated
product: ["яблоко", "груша", "гриб", "огурец"], | ||
building: ["Дом", "Банк", "Больница", "Театр"], | ||
}; | ||
const search = "ко"; |
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.
у тебя это аргумент subString
} | ||
// Как сделать с prompt? | ||
}; | ||
alert(evenNum(7)); |
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.
alert(evenNum(prompt('введите число')));
} | ||
}); | ||
return null; |
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.
возваращай arr
Добрый день. ДЗ сделал, есть вопросы в комментариях