Skip to content

Conversation

@gidra5
Copy link

@gidra5 gidra5 commented Oct 16, 2019

No description provided.

Copy link
Member

@tshemsedinov tshemsedinov left a comment

Choose a reason for hiding this comment

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

Add {} everywhere

// For example sum(1, 2, 3) should return 6
let acc = 0;
for (let i = 0; i < args.length; ++i)
acc += args[i];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
acc += args[i];
acc += args[i];
}

// to calculate sum of all given arguments
// For example sum(1, 2, 3) should return 6
let acc = 0;
for (let i = 0; i < args.length; ++i)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for (let i = 0; i < args.length; ++i)
for (let i = 0; i < args.length; ++i) {

// to calculate sum of all given arguments
// For example sum(1, 2, 3) should return 6
let acc = 0;
for (const num of args)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for (const num of args)
for (const num of args) {

let acc = 0;
for (const num of args)
acc += num;

Copy link
Member

Choose a reason for hiding this comment

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

}

// to calculate sum of all given arguments
// For example sum(1, 2, 3) should return 6
let accum = 0;
while (args.length !== 0)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
while (args.length !== 0)
while (args.length !== 0) {

let accum = 0;
while (args.length !== 0)
accum += args.pop();

Copy link
Member

Choose a reason for hiding this comment

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

}


for (let row = 0; row < matrix.length; ++row)
for (let column = 0; column < matrix[row].length; ++column)
maxVal = (matrix[row][column] > maxVal) ? matrix[row][column] : maxVal;
Copy link
Member

Choose a reason for hiding this comment

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

Use code blocks {}

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