首页 > 其他 > 详细

TypeScript学习

时间:2019-02-17 18:53:59      阅读:209      评论:0      收藏:0      [点我收藏+]

1. <>一种为泛型,作为类型模板

另一种如下表示类型转换( Type Assertion or casting)

let square = <Square>{};
let square = {} as Square;

2. 函数完整形式:参数列表 => 返回类型 = 函数体,...args: 数组表示任意个数的参数

const Inject: (...args: any[]) => any = ioc.Inject;

 

TypeScript学习

原文:https://www.cnblogs.com/demian/p/10392180.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!