Skip to content

Дюкин Петр, ts-1#7

Open
diukin wants to merge 1 commit intoRTF-Angular-2021:masterfrom
diukin:diukin_peter
Open

Дюкин Петр, ts-1#7
diukin wants to merge 1 commit intoRTF-Angular-2021:masterfrom
diukin:diukin_peter

Conversation

@diukin
Copy link

@diukin diukin commented Apr 1, 2021

No description provided.

@diukin diukin changed the title Дкюин Петр, ts-1 Дюкин Петр, ts-1 Apr 1, 2021
numbersOrDatesArrayProp: Array<number | Date>,
functionProp: Function
};

Copy link

Choose a reason for hiding this comment

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

Зачтено на 3 балла

if (typeof item === type) res.push(item)
});
return res;
}
Copy link

Choose a reason for hiding this comment

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

Работать не будет, т.к. в рантайме у x будет тип Object => ни один объект не попадет результирующий массив

function add(x: string | number, y: string | number): string | number {
return typeof x === "string" ? <string>x + <string>y : <number>x + <number>y;
}

Copy link

Choose a reason for hiding this comment

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

Зачтено на 3 балла

* мое понимание в их различии стало именно таким. Думаю, что нет смысла копировать и переводить
* материал оттуда, да и врать, что взял все это из головы - тоже..)
* В любом случае извините...)
*/ No newline at end of file
Copy link

Choose a reason for hiding this comment

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

Зачтено на 3 балла

export function filterUsers(persons: Person[], criteria: HybridUser): User[] {
return persons.filter(isUser).filter((user) => {
const criteriaKeys = Object.keys(criteria);
return criteriaKeys.every((fieldName) => {
Copy link

Choose a reason for hiding this comment

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

Зачтено на 3 балла

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