Skip to content

Week 2#2

Open
soroka129 wants to merge 3 commits intomasterfrom
week-2
Open

Week 2#2
soroka129 wants to merge 3 commits intomasterfrom
week-2

Conversation

@soroka129
Copy link
Copy Markdown
Owner

Выполненное ДЗ неделя 2

for (let i = 0; i < array.length; i++) {
fn(array[i], i, array);
}
//function fn(item, i, array) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

убрать все коменты

a = fn(array[i], i, array);
newArr.push(a);
}
//function fn(item) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Так не делают. Если надо оставить коменты то сначала полезный код(return в данном случае) потом комментарии, а так золотое правило на ревью коменты не отправляем

for (; i < array.length; i++) {
s = fn(s, array[i], i, array);
}
//function fn(sum, item) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Аналогично предыдущему

let tr = 0;
let fal = 0;
//try {
if (!Array.isArray(array) || array.length === 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Запрещено использовать встроенные методы для работы с массивами

}

if (tr === array.length) {
console.log(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Здесь и далее console.log здесь смысл такой как с комментариями в финальном коде их быть не должно

let tr = 0;
let fal = 0;
//try {
if (!Array.isArray(array) || array.length === 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Запрещено использовать встроенные методы для работы с массивами

@@ -0,0 +1,236 @@
/* ДЗ 3 - работа с исключениями и отладчиком */

//import { error } from 'console';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

убрать


for (let i = 0; i < array.length; i++) {
const z = fn(array[i], i, array);
if (z === true) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

z ? tr++ : fal++; так оно как то получше будет.
Тут булевое значение, если уже и мы его проверяем то if-else будет достатоно


for (let i = 0; i < array.length; i++) {
const z = fn(array[i], i, array);
if (z === true) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

z ? tr++ : fal++; так оно как то получше будет.
Тут булевое значение, если уже и мы его проверяем то if-else будет достатоно

},
};
}
/*const myCalc = calculator();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

убрать

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