-
Notifications
You must be signed in to change notification settings - Fork 0
Week 2 #2
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
projects/array-objects/index.js
Outdated
| for (let i = 0; i < array.length; i++) { | ||
| fn(array[i], i, array); | ||
| } | ||
| //function fn(item, i, 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.
убрать все коменты
projects/array-objects/index.js
Outdated
| a = fn(array[i], i, array); | ||
| newArr.push(a); | ||
| } | ||
| //function fn(item) { |
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.
Так не делают. Если надо оставить коменты то сначала полезный код(return в данном случае) потом комментарии, а так золотое правило на ревью коменты не отправляем
projects/array-objects/index.js
Outdated
| for (; i < array.length; i++) { | ||
| s = fn(s, array[i], i, array); | ||
| } | ||
| //function fn(sum, item) { |
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 tr = 0; | ||
| let fal = 0; | ||
| //try { | ||
| if (!Array.isArray(array) || array.length === 0) { |
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.
Запрещено использовать встроенные методы для работы с массивами
projects/exceptions/index.js
Outdated
| } | ||
|
|
||
| if (tr === array.length) { | ||
| console.log(true); |
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.
Здесь и далее console.log здесь смысл такой как с комментариями в финальном коде их быть не должно
| let tr = 0; | ||
| let fal = 0; | ||
| //try { | ||
| if (!Array.isArray(array) || array.length === 0) { |
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.
Запрещено использовать встроенные методы для работы с массивами
projects/exceptions/index.js
Outdated
| @@ -0,0 +1,236 @@ | |||
| /* ДЗ 3 - работа с исключениями и отладчиком */ | |||
|
|
|||
| //import { error } from 'console'; | |||
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.
убрать
projects/exceptions/index.js
Outdated
|
|
||
| for (let i = 0; i < array.length; i++) { | ||
| const z = fn(array[i], i, array); | ||
| if (z === true) { |
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.
z ? tr++ : fal++; так оно как то получше будет.
Тут булевое значение, если уже и мы его проверяем то if-else будет достатоно
projects/exceptions/index.js
Outdated
|
|
||
| for (let i = 0; i < array.length; i++) { | ||
| const z = fn(array[i], i, array); | ||
| if (z === true) { |
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.
z ? tr++ : fal++; так оно как то получше будет.
Тут булевое значение, если уже и мы его проверяем то if-else будет достатоно
projects/exceptions/index.js
Outdated
| }, | ||
| }; | ||
| } | ||
| /*const myCalc = calculator(); |
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.
убрать
Выполненное ДЗ неделя 2