学习笔记jira项目18-实现登录表单ts类型1
module.exports = (req, res, next) => { if (req.method === "POST" && req.path === "/login") { if (req.body.username === "jack" && req.body.password === "123456") { ...
ts重点学习96-映射类型笔记
export default {} // 旧的接口 interface IPerson { name: string; age: number; } // 只读 type ReadonlyTest<T> = { // 遍历指定类型所有的key,并添加到当前类型上 // obj = {a: 1} obj[a] readonly [P in keyof T]: T[...
ts重点学习98-映射类型2笔记
export default {} // Record映射类型 // 他会将一个类型的所有属性值都映射到另一个类型上并创造一个新的类型 type Name = "person" | "animal"; type Person = { name: string; age: number } // 注意点: 想要谁作为名称谁就写在前面, 想要谁作为最底层的属性,谁就写在后面 type New...
ts重点学习107-函数类型得兼容性知识点
export default {} // 参数个数 // 注意点: 可少不可多 // let func1 = (a: number, b: string) => {} // let func2 = (x: number) => {} // func1 = func2; // func2 = func1; // 参数类型 // 注意点: 参数类型必须相同 // let func1 = ....
ts重点学习100-其他公共类型笔记
export default {} // Required<Type> // 构建一个由 Type 的所有属性组成的类型,设置为必填。与 Partial 相反 interface IPerson { name?: string; age?: number; } let res: IPerson = { name: "舒畅" } let res2: Required<...
ts重点学习86-map类型笔记
export default {} // 创建 let nameSiteMapping = new Map(); // 设置 nameSiteMapping.set("邱淑贞", 1); nameSiteMapping.set("宋茜", 2); nameSiteMapping.set("景甜", 3); // 获取键队友的值 // console.log(nameSiteMapping.get....
本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。