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

lab tasks 1, 2, 3, 4, 5, 6, 7, 8, 9, a #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shchadyloTaras
Copy link

No description provided.

@@ -14,7 +14,7 @@
отдает массив нечетных чисел из диапазона [15, 30] включая крайние числа.

## Функции

~~~~
Copy link
Member

Choose a reason for hiding this comment

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

Why do you committing changes to readme?

@@ -1,5 +1,5 @@
'use strict';

const year = undefined;
const year = 1917;
Copy link
Member

Choose a reason for hiding this comment

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

64908rm_25_954

@@ -1,5 +1,5 @@
'use strict';

const hello = null;
const hello = name => console.log(`Hello, ${name}!`);
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
const hello = name => console.log(`Hello, ${name}!`);
const hello = name => {
console.log(`Hello, ${name}!`);
};

We use single line functions when outer function need to return value of internal call.

const range = null;

const range = (start, end) => {
const arr = [];
Copy link
Member

Choose a reason for hiding this comment

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

You may allocate array with final length. See solution: https://github.com/HowProgrammingWorks/Reusable/blob/master/Solutions/4-range.js


const findPhoneByName = null;
const findPhoneByName = name => {
for (const number of phonebook) number.name === name ? number.phone : null;
Copy link
Member

Choose a reason for hiding this comment

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

This will return undefined.

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