Skip to content

#6Task. Ihar Tsykala#787

Draft
IharTsykala wants to merge 11 commits into
ilya4321:masterfrom
IharTsykala:6Task
Draft

#6Task. Ihar Tsykala#787
IharTsykala wants to merge 11 commits into
ilya4321:masterfrom
IharTsykala:6Task

Conversation

@IharTsykala

Copy link
Copy Markdown

@KostyaKov KostyaKov left a comment

Copy link
Copy Markdown
Collaborator

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!

Comment thread task/06-conditions-n-loops-tasks.js Outdated
throw new Error('Not implemented');
if (num % 15 === 0) {
return "FizzBuzz"
} else if (num % 3 === 0) {

Copy link
Copy Markdown
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".

Comment thread task/06-conditions-n-loops-tasks.js Outdated
(b < a + c && b >= a && b >= c) ||
(c < a + b && c >= a && c >= b)
)
return true

Copy link
Copy Markdown
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;"

Comment thread task/06-conditions-n-loops-tasks.js Outdated
.map((x, idx) => (idx % 2 ? x * 2 : x))
.map((x) => (x > 9 ? (x % 10) + 1 : x))
.reduce((accum, x) => (accum += x)) %
10 ===

Copy link
Copy Markdown
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"

Comment thread task/06-conditions-n-loops-tasks.js Outdated
return sum + +current
}, 0)
return res
} else return res

Copy link
Copy Markdown
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"

Comment thread task/06-conditions-n-loops-tasks.js Outdated
*/
function getFactorial(n) {
throw new Error('Not implemented');
let mul = 1

Copy link
Copy Markdown
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 ";"

Comment thread task/06-conditions-n-loops-tasks.js Outdated
duration <= 90 * amountMillisecond.second
)
return comment.minute
else return comment.seconds

Copy link
Copy Markdown
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".

Comment thread task/06-conditions-n-loops-tasks.js Outdated
continue
}
}
if (arr.length) return false

Copy link
Copy Markdown
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.

Comment thread task/06-conditions-n-loops-tasks.js Outdated
position[i][0] === position[i][2] &&
position[i][0] !== undefined
)
return position[i][0]

Copy link
Copy Markdown
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[..."

Comment thread task/06-conditions-n-loops-tasks.js Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
Author

Please, accept my pr

@KostyaKov

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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