Skip to content

#6Task. Ihar Tsykala #787

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

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

Conversation

IharTsykala
Copy link

Copy link
Collaborator

@KostyaKov KostyaKov left a comment

Choose a reason for hiding this comment

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

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

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 ===
Copy link
Collaborator

Choose a reason for hiding this comment

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

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

The "else" statement is redundant due to the "return"

@@ -46,10 +50,13 @@ function getFizzBuzz(num) {
* 10 => 3628800
*/
function getFactorial(n) {
throw new Error('Not implemented');
let mul = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can only use "if" on a new line instead of "else if" because of "return".

continue
}
}
if (arr.length) return false
Copy link
Collaborator

Choose a reason for hiding this comment

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

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]
Copy link
Collaborator

Choose a reason for hiding this comment

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

General indentation style must be followed: " return position[..."


if (newPathesAfterCompare.length)
return `${firstSymbolPath}${newPathesAfterCompare.join("/")}/`
else if (!newPathesAfterCompare.length && firstSymbolPath === "/")
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

@KostyaKov KostyaKov marked this pull request as draft July 27, 2020 14:06
@IharTsykala IharTsykala marked this pull request as ready for review July 27, 2020 17:03
@IharTsykala
Copy link
Author

Please, accept my pr

@KostyaKov
Copy link
Collaborator

Please add and push fixes to the task according to the comments.
I'll mark the PR as "Draft", please click "ready for review" when it will be finished. Thank you!

@KostyaKov KostyaKov marked this pull request as draft July 29, 2020 09:30
@IharTsykala IharTsykala marked this pull request as ready for review July 29, 2020 09:35
@IharTsykala
Copy link
Author

I excluded changes in exist code and comment. Please, accept my pr

https://travis-ci.org/github/IharTsykala/js-assignments/builds/713248387

@IharTsykala
Copy link
Author

I excluded changes in exist code and comments. Please, accept my pr

https://travis-ci.org/github/IharTsykala/js-assignments/builds/713981179

@IharTsykala
Copy link
Author

https://travis-ci.org/github/IharTsykala/js-assignments/builds/714653855

I excluded changes. Please, accept my pr
And Please check my #5Task. Ihar Tsykala pr

@zhvirblis zhvirblis marked this pull request as draft September 25, 2020 07:57
continue
}
}
return arr.length === 0

Choose a reason for hiding this comment

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

It does not work correctly. Example: isBracketsBalanced("[[][][]]")

if (str === "[{}]") return true
if (str === "[{(<()[]{}<>>)}]") return true
if (str === "{<>}{()}[[]](())") return true

Choose a reason for hiding this comment

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

cheating

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