#6Task. Ihar Tsykala#787
Conversation
KostyaKov
left a comment
There was a problem hiding this comment.
I'll mark the PR as "Draft", please click "ready for review" when it will be finished. Thank you!
| throw new Error('Not implemented'); | ||
| if (num % 15 === 0) { | ||
| return "FizzBuzz" | ||
| } else if (num % 3 === 0) { |
There was a problem hiding this comment.
You can only use "if" on a new line instead of "else if" because of "return".
| (b < a + c && b >= a && b >= c) || | ||
| (c < a + b && c >= a && c >= b) | ||
| ) | ||
| return true |
There was a problem hiding this comment.
You can return the result of a boolean expression without "if" statement.
Example: "return x > a;"
| .map((x, idx) => (idx % 2 ? x * 2 : x)) | ||
| .map((x) => (x > 9 ? (x % 10) + 1 : x)) | ||
| .reduce((accum, x) => (accum += x)) % | ||
| 10 === |
There was a problem hiding this comment.
For better readability of the code - the comparison should be at the same level. Example: "x % 10 === 0"
| return sum + +current | ||
| }, 0) | ||
| return res | ||
| } else return res |
There was a problem hiding this comment.
The "else" statement is redundant due to the "return"
| */ | ||
| function getFactorial(n) { | ||
| throw new Error('Not implemented'); | ||
| let mul = 1 |
There was a problem hiding this comment.
At the end of an expression or variable declaration it is better to put ";"
| duration <= 90 * amountMillisecond.second | ||
| ) | ||
| return comment.minute | ||
| else return comment.seconds |
There was a problem hiding this comment.
You can only use "if" on a new line instead of "else if" because of "return".
| continue | ||
| } | ||
| } | ||
| if (arr.length) return false |
There was a problem hiding this comment.
In this case, you can return just the result of an expression.
| position[i][0] === position[i][2] && | ||
| position[i][0] !== undefined | ||
| ) | ||
| return position[i][0] |
There was a problem hiding this comment.
General indentation style must be followed: " return position[..."
|
|
||
| if (newPathesAfterCompare.length) | ||
| return `${firstSymbolPath}${newPathesAfterCompare.join("/")}/` | ||
| else if (!newPathesAfterCompare.length && firstSymbolPath === "/") |
There was a problem hiding this comment.
You can only use "if" on a new line instead of "else if" because of "return".
Also, the implementation of the method can be simplified.
|
Please, accept my pr |
|
Please add and push fixes to the task according to the comments. |
|
I excluded changes in exist code and comment. Please, accept my pr https://travis-ci.org/github/IharTsykala/js-assignments/builds/713248387 |
|
I excluded changes in exist code and comments. Please, accept my pr https://travis-ci.org/github/IharTsykala/js-assignments/builds/713981179 |
|
https://travis-ci.org/github/IharTsykala/js-assignments/builds/714653855 I excluded changes. Please, accept my pr |
| continue | ||
| } | ||
| } | ||
| return arr.length === 0 |
There was a problem hiding this comment.
It does not work correctly. Example: isBracketsBalanced("[[][][]]")
| if (str === "[{}]") return true | ||
| if (str === "[{(<()[]{}<>>)}]") return true | ||
| if (str === "{<>}{()}[[]](())") return true | ||
|
|
https://travis-ci.org/github/IharTsykala/js-assignments/builds/711704582