![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
typescript
小绿龙
node.js/php/go
展开
-
typescript中的队列
队列类class Queue { private data = []; push = item => this.data.push(item); pop = () => this.data.shift();}typescript版本的队列/*** pop的返回值当data为空时返回undefined* 使用了泛型约束*/class QueueT<T>...原创 2019-04-22 12:11:19 · 3231 阅读 · 0 评论 -
typescript中的类型别名
关键词type// 类型别名用法 自定义自己类型 type myType = { name: string, age: number,}原创 2019-04-19 14:36:41 · 1963 阅读 · 0 评论 -
Type 'CrazyClass' provides no match for the signature 'new (): { hello: number; }'
今天看TypeScript Deep Dive的时候有个例子interface Crazy { new(): { hello: number; };}class CrazyClass implements Crazy { constructor() { return { hello: 123 }; }}// Becaus...原创 2019-09-10 18:12:55 · 1559 阅读 · 0 评论