-
Notifications
You must be signed in to change notification settings - Fork 194
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
base: master
Are you sure you want to change the base?
#6 task aleksey prusevich #910
Conversation
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.
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 |
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.
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); |
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.
Why should we use additional value (0.00001) ?
((point.x - circle.center.x) ** 2 + (point.y - circle.center.y) ** 2 < (circle.radius) ** 2)
works
if (searchChar == newStr[j]) | ||
{ | ||
break INNER_LOOP; | ||
} | ||
if (j + 1 == newStr.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.
"operator === is always preferable
sometimes ''==' may cause an error
(check at console :
'0' == 0
and '0' === 0)"
evenChar = !evenChar; | ||
} | ||
|
||
return (sum % 10) == 0; |
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.
operator === is always preferable
|
||
for (let i = 0; i < arr1.length; i++) | ||
{ | ||
if (arr1[i] == arr2[i]) |
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.
operator === is always preferable
|
||
for (let i = 0; i < arr1.length; i++) | ||
{ | ||
if ((arr1[i] == arr2[i]) && (arr2[i] == arr3[i])) |
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.
operator === is always preferable
https://travis-ci.org/github/AlekseyPrusevich/js-assignments/builds/717318799