-
Notifications
You must be signed in to change notification settings - Fork 0
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
Lesson02 #2
base: master
Are you sure you want to change the base?
Lesson02 #2
Conversation
…няет тесты обеих ДЗ, но в порядку выполнения дз сказано сделать для каждой дз ветку, а следовательно в lesson02 всегда будут проваливаться тесты с lesson01
02/tasks.js
Outdated
@@ -24,7 +23,14 @@ function timer(logger = console.log) { | |||
* @return {Function} функция с нужным контекстом | |||
*/ | |||
function customBind(func, context, ...args) { | |||
const oldArgs = args; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
02/tasks.js
Outdated
const oldArgs = args; | ||
|
||
return function() { | ||
const newArg = [].slice.call(arguments); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
02/tasks.js
Outdated
|
||
return function() { | ||
const newArg = [].slice.call(arguments); | ||
const Args = [].concat(oldArgs, newArg); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -49,9 +63,26 @@ function sum(x) { | |||
* @return {boolean} | |||
*/ | |||
function anagram(first, second) { | |||
return false; | |||
} | |||
let isAnagram = false; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
isAnagram = true; | ||
} else { | ||
isAnagram = false; | ||
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.
есть отличный метод у массива join
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.
Есть.. Но чем он тут может помочь ?
@@ -7,13 +7,12 @@ | |||
* Доп. задание: предложите несколько вариантов решения. | |||
*/ | |||
function timer(logger = console.log) { | |||
for (var i = 0; i < 10; i++) { | |||
for (let i = 0; i < 10; i++) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
02/tasks.js
Outdated
@@ -37,6 +43,14 @@ function customBind(func, context, ...args) { | |||
* sum :: void -> Number | |||
*/ | |||
function sum(x) { | |||
if (arguments.length > 0) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
02/tasks.js
Outdated
countReplace++; | ||
} | ||
} | ||
if (countReplace > 1 || left.length !== right.length) { |
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.
эту проверку бы в самое начало, а то мы сделали перебор, а строки разного размера
left.length !== right.length
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.
А мы перебор не делаем. Строки сравниваются вторым условием в for(). То есть перебора бы все равно не было. Но замечание принял и вынес в отдельное условие
…не нужны html/css
… eslint ругается на var)
Дз сделано. Но travis всегда сваливается, eslint не работает (так и не понял как его настроить - установил плагин, пытался включить для папки 02 указав путь к .eslintrc - он подчеркивает каждый перенос строки, плюс ругается на отсутствие модуля eslint-config-airnb, хотя тот лежит в нужной папке). Зачем pre-push, если он не дает запушить, так как первая дз выполнена в другой ветки (по Порядку выполнения домашних работ) и тесты, естественно, всегда будут сваливаться?