Skip to content
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

#6 task aleksey prusevich #910

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

Conversation

Copy link
Collaborator

@vramaniuk vramaniuk 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!

@@ -82,7 +103,7 @@ function getSumBetweenNumbers(n1, n2) {
* 10,10,10 => true
*/
function isTriangle(a,b,c) {
throw new Error('Not implemented');
return ((a < b+c) && (b < a+c) && (c < a+b)) ? true : false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please, spaces between operators
Please, try to follow these rules https://javascript.info/coding-style

we can just return ((a < b + c) && (b < a + c) && (c < a + b))
Please, see https://javascript.info/logical-operators

@@ -150,7 +176,7 @@ function doRectanglesOverlap(rect1, rect2) {
*
*/
function isInsideCircle(circle, point) {
throw new Error('Not implemented');
return ((point.x - circle.center.x) ** 2 + (point.y - circle.center.y) ** 2 <= (circle.radius - 0.00001) ** 2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why should we use additional value (0.00001) ?
((point.x - circle.center.x) ** 2 + (point.y - circle.center.y) ** 2 < (circle.radius) ** 2) works

Comment on lines +206 to +210
if (searchChar == newStr[j])
{
break INNER_LOOP;
}
if (j + 1 == newStr.length)
Copy link
Collaborator

Choose a reason for hiding this comment

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

"operator === is always preferable
sometimes ''==' may cause an error
(check at console :
'0' == 0
and '0' === 0)"

evenChar = !evenChar;
}

return (sum % 10) == 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

operator === is always preferable


for (let i = 0; i < arr1.length; i++)
{
if (arr1[i] == arr2[i])
Copy link
Collaborator

Choose a reason for hiding this comment

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

operator === is always preferable


for (let i = 0; i < arr1.length; i++)
{
if ((arr1[i] == arr2[i]) && (arr2[i] == arr3[i]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

operator === is always preferable

@vramaniuk vramaniuk marked this pull request as draft August 24, 2020 13:48
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.

2 participants