Skip to content

Conversation

SergeyTsvirko
Copy link

@vramaniuk vramaniuk self-requested a review August 17, 2020 14:29
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!

Comment on lines +33 to +35
if ((num%3 == 0) && (num%5 == 0)) return 'FizzBuzz';
if (num%3 == 0) return 'Fizz';
return (num%5 == 0) ? 'Buzz' : num;
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)"

*/
function isInsideCircle(circle, point) {
throw new Error('Not implemented');
return circle.radius > Math.sqrt(Math.pow(point.x - circle.center.x, 2) + Math.pow(point.y - circle.center.y, 2));
Copy link
Collaborator

Choose a reason for hiding this comment

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


const isEqualsOne = (element) => element == 1;
let nonRepeatedChar = Array.from(map.keys())[Array.from(map.values()).findIndex(isEqualsOne)];
return nonRepeatedChar ? nonRepeatedChar : null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

ternary operator is redundant here
Please, see https://javascript.info/logical-operators
we can return just nonRepeatedChar with the same result

map.set(item, map.get(item)+1);
})

const isEqualsOne = (element) => element == 1;
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

Comment on lines +291 to +295
if ((index - 1 == 0) && parity) {
total = changeItem(total);
}

if ((index %2 == 0) && parity) {
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

let matchSet = new Set(vertical);

JSON.parse(JSON.stringify(position)).reduce(function(total, current, index) {
if (total[position.length-index] != current[position.length-index-1]) {
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

current[position.length-index-1] = '';
}

if (position.length-1 == index) matchSet.add(current[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

current[index] = '';
}

if (position.length-1 == index) matchSet.add(current[position.length-1]);
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

})

JSON.parse(JSON.stringify(position)).reduce(function(total, current, index) {
if (total[index-1] != current[index]) {
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

Comment on lines +612 to +614
if (elem == 'X') counterX++;
if (elem == '0') counter0++;
if ((counterX == 3) || (counter0 == 3)) matchSet.add(elem);
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 17, 2020 14:43
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