-
Notifications
You must be signed in to change notification settings - Fork 15
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
Михалев Кирилл #16
base: master
Are you sure you want to change the base?
Михалев Кирилл #16
Conversation
type FooType = unknown; | ||
type BarType = unknown; | ||
type FooType = {stringProp:string,numberProp:number,barObject:BarType}; | ||
type BarType = {stringsArrayProp:Array<string>,numbersOrDatesArrayProp:Array<Date|number>,functionProp:Function}; | ||
|
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.
Зачтено на 3 балла
if (typeof x === 'number' && typeof y === 'number') | ||
return x + y; | ||
throw new Error; | ||
} | ||
|
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.
Зачтено на 3 балла
type не может иметь несколько объявлений. | ||
3)type - создает новое имя для типа, inteface - обеспечивает способ определения сущностей. | ||
4)type не может быть реализован,только объявлен,а члены interface реализуются производным классом. | ||
*/ |
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.
Зачтено на 3 балла
@@ -73,7 +73,7 @@ export function logPerson(person: Person) { | |||
console.log(` - ${person.name}, ${person.age}, ${additionalInformation}`); | |||
} | |||
|
|||
export function filterUsers(persons: Person[], criteria: User): User[] { | |||
export function filterUsers(persons: Person[], criteria: {type?: string, name?: string, age?: number, occupation?: string}): User[] { | |||
return persons.filter(isUser).filter((user) => { | |||
const criteriaKeys = Object.keys(criteria); | |||
return criteriaKeys.every((fieldName) => { |
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.
Зачтено на 3 балла
No description provided.