Skip to content

Exercise is done #25

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

Closed
wants to merge 10 commits into from
Closed

Exercise is done #25

wants to merge 10 commits into from

Conversation

krls256
Copy link

@krls256 krls256 commented Oct 21, 2019

No description provided.

// to calculate sum of all given arguments
// For example sum(1, 2, 3) should return 6
if (args.length === 0) return 0;
let i = 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
let i = 0,
let i = 0;

// For example sum(1, 2, 3) should return 6
if (args.length === 0) return 0;
let i = 0,
sum = 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
sum = 0;
let sum = 0;

do {
sum += args[i];
i++;
} while (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
} while (args[i]);
} while (i < args.length);

// }
const ageList = {};
for (const index in persons) {
ageList[index] = persons[index]['died'] - persons[index]['born'];
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
ageList[index] = persons[index]['died'] - persons[index]['born'];
const person = persons[index];
ageList[index] = persons.died - persons.born;

@@ -5,7 +5,7 @@
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",
"license": "MIT",
"scripts": {
"test": "eslint ./Exercises; hpw"
"test": "eslint ./Exercises && hpw"
Copy link
Member

Choose a reason for hiding this comment

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

Don't change package.json

@krls256 krls256 closed this by deleting the head repository Nov 19, 2024
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.

3 participants