Skip to content

Tasks done#20

Open
gidra5 wants to merge 6 commits intoHowProgrammingWorks:masterfrom
gidra5:master
Open

Tasks done#20
gidra5 wants to merge 6 commits intoHowProgrammingWorks:masterfrom
gidra5:master

Conversation

@gidra5
Copy link
Copy Markdown

@gidra5 gidra5 commented Oct 16, 2019

No description provided.

Copy link
Copy Markdown
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

Comment thread Exercises/1-for.js
// 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
Copy Markdown
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];
}

Comment thread Exercises/1-for.js
// 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
Copy Markdown
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) {

Comment thread Exercises/2-for-of.js
// 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
Copy Markdown
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) {

Comment thread Exercises/2-for-of.js
let acc = 0;
for (const num of args)
acc += num;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

}

Comment thread Exercises/3-while.js
// 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
Copy Markdown
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) {

Comment thread Exercises/3-while.js
let accum = 0;
while (args.length !== 0)
accum += args.pop();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

}

Comment thread Exercises/6-matrix.js

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
Copy Markdown
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