-
Notifications
You must be signed in to change notification settings - Fork 0
Hw6 #10
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
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.
Подводя итог, могу сказать, что работа выполнена хорошо. Рада видеть реализацию дополнительных заданий.
Предлагаю доработать 4-ю задачу и отправить код на повторную проверку.
const numbers = [1, 5, 4, 10, 0, 3]; | ||
|
||
for (let i = 0; i < numbers.length; i++) { | ||
if (numbers[i] <= 10) break; |
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.
По итогу мы получим undefined, потому что в условии происходит сравнение (меньше или равно). Нам нужно проверить на строгое равенство с 10, правильно будет так:
if (numbers[i] === 10) break;
Также нужно поменять условие и вывод через alert местами, так как по условию нужно вывести 10 в том числе.
hw6script.js
Outdated
numbers = numbers.join(" "); | ||
alert(numbers); | ||
// Exersice 4 | ||
let array = [ |
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.
Выполнено не совсем корректно. Так должен выглядеть итоговый результат, начальное значение – пустой массив []
. За счет вложенных циклов нужно реализовать решение.
let search = numbers.includes(num); | ||
alert(numbers.includes(num)); | ||
// Exersice 8 | ||
let letters = "abcdef"; |
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.
Решено задание верно, однако можно выполнить сокращение и сгруппировать методы.
Получится так:
let line = 'abcdef'; let lineReverse = line.split('').reverse().join(''); console.log(lineReverse);
Добрый вечер!
Проверьте пожалуйста дз