Skip to content

Conversation

@shchadyloTaras
Copy link

No description provided.


## Функции

~~~~
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?

'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

'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