-
Notifications
You must be signed in to change notification settings - Fork 117
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
base: master
Are you sure you want to change the base?
Гафурова Софья #86
Conversation
🍅 Пройдено тестов 21 из 26 |
🍅 Пройдено тестов 21 из 23 |
🍅 Не пройден линтинг или базовые тесты |
🍏 Пройдено тестов 23 из 23 |
phone-book.js
Outdated
@@ -4,12 +4,12 @@ | |||
* Сделано задание на звездочку | |||
* Реализован метод importFromCsv | |||
*/ | |||
const isStar = true; | |||
const isStar = false; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)}`; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatPhone?
🍅 Пройдено тестов 23 из 26 |
No description provided.