Skip to content

Conversation

@soroka129
Copy link
Owner

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

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

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

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

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

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

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

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

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

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

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

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.

4 participants