-
Notifications
You must be signed in to change notification settings - Fork 12
ex_hoanglx ex1~ex6 #28
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
base: main
Are you sure you want to change the base?
Conversation
bd44d94 to
26dc269
Compare
ex1_hoanglx/ex5.ts
Outdated
| console.log(` - ${person.name}, ${person.age}, ${additionalInformation}`); | ||
| } | ||
|
|
||
| export function filterUsers(persons: Person[], criteria: Pick<Person, Exclude<keyof Person, "name" | "occupation" | "type" >>): User[] { |
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.
có cách nào gọn hơn k?
ex1_hoanglx/ex6.ts
Outdated
| ); | ||
| } | ||
|
|
||
| export function filterPersons(persons: Person[], personType: string, criteria: unknown): Person[] { |
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.
unknown mà giải quyết vấn đề gì, làm nghiêm chỉnh vào coi
26dc269 to
8abca60
Compare
ex1_hoanglx/ex5.ts
Outdated
| console.log(` - ${person.name}, ${person.age}, ${additionalInformation}`); | ||
| } | ||
|
|
||
| export function filterUsers(persons: Person[], criteria: Omit<Person, "name" | "occupation" | "type" >): User[] { |
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.
đã pass đâu
ex1_hoanglx/ex6.ts
Outdated
| ); | ||
| } | ||
|
|
||
| export function filterPersons(persons: Person[], personType: string, criteria: Omit<Person, "name" | "type" >): Person[] { |
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.
bài này cũng chưa pass
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.
@phantien133 code này vẫn chạy được nghe anh theo em nghỉ là thằng occupation và role không thuộc đối tượng bắt buộc của Person nên lúc này mình chỉ cần exclude name và type ra ngoài thôi anh, còn nếu define thì nó thừa mất

em ko biết là mình hiểu đúng ko nữa nhưng mà thấy chạy được và ko mất thông tin nào cả. tương tự bài 5 cũng vậy anh
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.
@hoanglx-2672 chạy đc là 1 chuyện, đúng hay sai là chuyện khác
No description provided.