Skip to content

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

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

Hw6 #10

wants to merge 9 commits into from

Conversation

NosovDima
Copy link
Owner

Добрый вечер!
Проверьте пожалуйста дз

Copy link

@Mielilon Mielilon left a 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;

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 = [

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";

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);

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