-
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
Мартовицкая Вероника #109
base: master
Are you sure you want to change the base?
Мартовицкая Вероника #109
Conversation
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍏 Пройдено тестов 26 из 26 |
@FrodoTheTrue обрати внимание: решено доп. задание |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍅 Не пройден линтинг или базовые тесты |
🍏 Пройдено тестов 26 из 26 |
@FrodoTheTrue обрати внимание: решено доп. задание |
phone-book.js
Outdated
@@ -30,16 +55,51 @@ function add(phone, name, email) { | |||
* @returns {Boolean} | |||
*/ | |||
function update(phone, name, email) { | |||
if (phoneBook[phone] && isValidParams(phone, name, email)) { | |||
if (!email || (email === '')) { |
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.
скобки лишние
phone-book.js
Outdated
return 0; | ||
} | ||
let res; | ||
var count = 0; |
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.
let
phone-book.js
Outdated
} | ||
let res; | ||
var count = 0; | ||
for (var phone of Object.keys(phoneBook)) { |
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.
const
phone-book.js
Outdated
return []; | ||
} | ||
const result = []; | ||
var res; |
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.
let
phone-book.js
Outdated
} | ||
|
||
function view(result) { | ||
var recordSought = []; |
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.
const
phone-book.js
Outdated
return 0; | ||
} | ||
const newCsv = csv.split('\n'); | ||
var count = 0; |
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.
let
phone-book.js
Outdated
function isValidParams(phone, name) { | ||
var tel = /(^[0-9]{10}$)/; | ||
|
||
return phone && (tel.test(phone)) && (name !== '') && |
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.
скобки
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.
name !== ''
можно не проверять
🍏 Пройдено тестов 26 из 26 |
@FrodoTheTrue обрати внимание: решено доп. задание |
@@ -19,6 +33,17 @@ let phoneBook; | |||
* @returns {Boolean} | |||
*/ | |||
function add(phone, name, email) { | |||
if (!(phone in phoneBook) && isValidParams(phone, name, email)) { | |||
if (!email || email === '') { |
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
* @returns {Boolean} | ||
*/ | ||
function isValidParams(phone, name) { | ||
var tel = /(^[0-9]{10}$)/; |
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.
const
@@ -30,16 +55,51 @@ function add(phone, name, email) { | |||
* @returns {Boolean} | |||
*/ | |||
function update(phone, name, email) { | |||
if (phoneBook[phone] && isValidParams(phone, name, email)) { | |||
if (!email || email === '') { |
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
if (query === '*') { | ||
return record; | ||
} | ||
if (record[0].includes(query) === true || record[1].includes(query) === true || |
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.
давай извлечем из record все сразу
result.push(res); | ||
} | ||
} | ||
var record; |
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.
const
var record; | ||
record = view(result); | ||
|
||
return record.sort(); |
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.
как сортируем?
let count = 0; | ||
for (let line of newCsv) { | ||
let contact = line.split(';'); | ||
var phone = contact[1]; |
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.
const
for (let line of newCsv) { | ||
let contact = line.split(';'); | ||
var phone = contact[1]; | ||
var name = contact[0]; |
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.
const
let contact = line.split(';'); | ||
var phone = contact[1]; | ||
var name = contact[0]; | ||
var email = contact[2]; |
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.
const
No description provided.