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

Гафурова Софья #86

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

Conversation

sofelvpopel
Copy link

No description provided.

@honest-hrundel honest-hrundel changed the title qwe Гафурова Софья Oct 24, 2018
@honest-hrundel
Copy link

🍅 Пройдено тестов 21 из 26

@honest-hrundel
Copy link

🍅 Пройдено тестов 21 из 23

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍏 Пройдено тестов 23 из 23

phone-book.js Outdated
@@ -4,12 +4,12 @@
* Сделано задание на звездочку
* Реализован метод importFromCsv
*/
const isStar = true;
const isStar = false;
Copy link

@Xrias Xrias Oct 25, 2018

Choose a reason for hiding this comment

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

У тебя код написан на звездочку, а здесь false?

@@ -18,8 +18,21 @@ let phoneBook;
* @param {String?} email
* @returns {Boolean}
*/
function add(phone, name, email) {
function add(phone, name = '', email = '') {
const validPhone = /^(\d)\1\1(\d)\2\2(\d)\3(\d)\4$/.test(phone);
Copy link

Choose a reason for hiding this comment

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

Можно же /^\d{10}$/.test(phone). Повтори регулярки.


if (!validPhone || !name || contact) {
Copy link

Choose a reason for hiding this comment

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

!validPhone || !name || phoneBook[phone]
Можно и не выносить в переменную

const result = findAll(query);

return result.map(c => {
let r = `${c.name}, ${toFullPhone(c.phone)}`;
Copy link

Choose a reason for hiding this comment

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

Переименуй r и c на что-то информативное.

return allContacts;
}

function toFullPhone(phone) {
Copy link

Choose a reason for hiding this comment

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

formatPhone?

@honest-hrundel
Copy link

🍅 Пройдено тестов 23 из 26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants