国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

做的好微信商城網(wǎng)站嗎seo顧問服務(wù)四川

做的好微信商城網(wǎng)站嗎,seo顧問服務(wù)四川,WordPress電影公司網(wǎng)站主題,山西網(wǎng)站建設(shè)哪家好前言 TypeScript 越來越火&#xff0c;現(xiàn)在很多前端團(tuán)隊(duì)都使用它&#xff0c;因此咱們前端碼農(nóng)要想勝任以后的前端工作&#xff0c;就要更加熟悉它。 入門練手題 interface A {x: number;y: number; }type T Partial<A>;const a: T { x: 0, y: 0 }; const b: T { …

前言

TypeScript 越來越火,現(xiàn)在很多前端團(tuán)隊(duì)都使用它,因此咱們前端碼農(nóng)要想勝任以后的前端工作,就要更加熟悉它。
在這里插入圖片描述

入門練手題

interface A {x: number;y: number;
}type T = Partial<A>;const a: T = { x: 0, y: 0 };
const b: T = { x: 0 };
const c: T = { y: 0 };
const d: T = {};type MyPartial<T> = {[P in keyof T]?: T[P];
};interface B {x?: number;y: number;
}type T0 = Required<B>;const a0: T0 = { x: 0, y: 0 };type MyRequired<T> = {[P in keyof T]-?: T[P];
};interface C {x?: number;y: number;
}type T1 = Readonly<C>;const a1: T1 = { x: 0, y: 0 };// a1.x=1type MyReadonly<T> = {readonly [P in keyof T]: T[P];
};interface Cat {age: number;gender: string;
}type CatName = "seraph" | "ashe" | "ahri";const cats: Record<CatName, Cat> = {seraph: { age: 10, gender: "male" },ashe: { age: 5, gender: "female" },ahri: { age: 16, gender: "female" },
};/* 在 TypeScript 中,當(dāng)你看到 K extends keyof any 這樣的表達(dá)時(shí),
它的作用是約束類型 K 為一個(gè)有效的類型,可以作為對象的鍵。
這里的 keyof any 是指所有可能的 JavaScript 值的鍵的聯(lián)合類型。
簡單來說,keyof any 通常等價(jià)于 string | number | symbol ,
因?yàn)樵?JavaScript 中,對象的鍵可以是這三種類型。
你可以使用 string,number 或者 symbol 作為對象屬性的鍵。 */type MyRecord<K extends keyof any, T> = {[P in K]: T;
};interface Todo {title: string;description: string;done: boolean;
}type TodoPreview = Pick<Todo, "title" | "done">;const todo: TodoPreview = {title: "play games",done: false,
};type MyPick<T, K extends keyof T> = {[P in K]: T[P];
};type E0 = Exclude<"a" | "b", "a">;type E1 = Exclude<string | number | (() => void), Function>;type MyExclude<T, U> = T extends U ? never : T;interface Todos {title: string;desc: string;done: boolean;no: number;
}type TodoPre = Omit<Todos, "desc">;const todopre: TodoPre = {title: "play",done: false,no: 2,
};type TodoInfo = Omit<Todos, "desc" | "no">;const todoInfo: TodoInfo = {title: "play",done: false,
};type MyOmit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;type E = Extract<"a" | "b", "a" | "f">;type E3 = Extract<string | number | (() => void), Function>;type MyExtrat<T, U> = T extends U ? T : never;declare function f(args: { a: number; b: string }): void;type P0 = Parameters<() => string>; // []type P1 = Parameters<(s: string) => void>; // [s: string]type P2 = Parameters<<T>(arg: T) => T>; // [arg: unknown]type P3 = Parameters<typeof f>;type MyParameters<T extends (...args: any) => any> = T extends (...args: infer P
) => any? P: never;type R = ReturnType<() => void>;const add = (x: number, y: number): number => {return x + y;
};type R1 = MyReturnType<typeof add>;type MyReturnType<T extends (...args: any) => any> = T extends (...args: any
) => infer R? R: any;
http://m.aloenet.com.cn/news/34674.html

相關(guān)文章:

  • 福田做棋牌網(wǎng)站建設(shè)哪家公司便宜信息發(fā)布平臺推廣
  • 制作精美網(wǎng)站建設(shè)售后完善信息流廣告代運(yùn)營
  • 天津做網(wǎng)站的公司營銷網(wǎng)絡(luò)推廣哪家好
  • 手機(jī)網(wǎng)站模板開發(fā)工具seo網(wǎng)絡(luò)營銷推廣公司深圳
  • 相冊模版網(wǎng)站圖片展示成人再就業(yè)培訓(xùn)班
  • 網(wǎng)站流量少宣傳產(chǎn)品的方式
  • 請人做網(wǎng)站后臺密碼推廣模式包括哪些模式
  • 復(fù)興網(wǎng)站制作網(wǎng)絡(luò)推廣文案策劃
  • 成都網(wǎng)站建設(shè)哪兒濟(jì)南興田德潤怎么聯(lián)系婁底seo
  • 網(wǎng)站的反鏈要怎么做近期國內(nèi)熱點(diǎn)新聞事件
  • 網(wǎng)站建設(shè)好學(xué)嗎google ads 推廣
  • 九江網(wǎng)站建設(shè)多少錢百度推廣客服電話24小時(shí)
  • 2012搭建wordpress網(wǎng)站seo專員招聘
  • 技術(shù)支持 東莞網(wǎng)站建設(shè)舞蹈培訓(xùn)免費(fèi)的網(wǎng)頁制作軟件
  • 怎么做網(wǎng)站排名優(yōu)化電子商務(wù)平臺
  • 珠海網(wǎng)站建立seo外鏈在線提交工具
  • 鮮花商城網(wǎng)站建設(shè)怎么找拉新推廣平臺
  • 手機(jī)app制作網(wǎng)站模板seo兼職論壇
  • 專業(yè)網(wǎng)站優(yōu)化報(bào)價(jià)優(yōu)化推薦
  • wordpress復(fù)制他人的網(wǎng)站網(wǎng)站收錄情況查詢
  • 推廣優(yōu)化濟(jì)南網(wǎng)絡(luò)優(yōu)化網(wǎng)站
  • 網(wǎng)站改版的原因微信怎么推廣自己的產(chǎn)品
  • wordpress 獲取文章評論百度app關(guān)鍵詞優(yōu)化
  • 博客做單頁網(wǎng)站網(wǎng)站建設(shè)的方法有哪些
  • 自己做的網(wǎng)頁怎么連接到網(wǎng)站某個(gè)產(chǎn)品營銷推廣方案
  • 紅色 網(wǎng)站配色seo優(yōu)化方式
  • 怎樣做網(wǎng)站導(dǎo)購教程足球排名最新排名世界
  • 打開網(wǎng)站后直接做跳轉(zhuǎn)頁面嗎百度怎么打廣告
  • 給企業(yè)做網(wǎng)站如何定價(jià)百度快照收錄
  • 沈陽高端做網(wǎng)站建設(shè)時(shí)事熱點(diǎn)新聞