从某个类型中挑出一些属性出来

    1. type Person = {
    2. name: string;
    3. age:number;
    4. gender:string
    5. }
    6. type P1 = Pick<Person, "name" | "age">; // { name: string; age: number; }
    7. const user:P1={
    8. name:'树哥',
    9. age:18
    10. }