#6 task aleksey prusevich#910
Conversation
vramaniuk
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!
| */ | ||
| 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.
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
| */ | ||
| 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.
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.
"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.
operator === is always preferable
|
|
||
| for (let i = 0; i < arr1.length; i++) | ||
| { | ||
| if (arr1[i] == arr2[i]) |
There was a problem hiding this comment.
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.
operator === is always preferable
https://travis-ci.org/github/AlekseyPrusevich/js-assignments/builds/717318799