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

Tasks done #20

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

Tasks done #20

wants to merge 6 commits into from

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.

None yet

2 participants