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

Мартовицкая Вероника #109

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

Conversation

Veronica2998
Copy link

No description provided.

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

@FrodoTheTrue обрати внимание: решено доп. задание

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

@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 === '')) {

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;

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)) {

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;

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 = [];

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;

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 !== '') &&

Choose a reason for hiding this comment

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

скобки

Choose a reason for hiding this comment

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

name !== '' можно не проверять

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

@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 === '') {

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}$)/;

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 === '') {

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

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;

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();

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];

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];

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];

Choose a reason for hiding this comment

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

const

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