![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
TypeScript
bboyjoe
勇气与智慧并行,才能越过人生的一座座高山。
展开
-
TypeScript 的接口的使用
1.接口的创建,示例如下 interface labelValue{ label:string; } //创建函数对接口进行调用 function printLabel(labelObj:labelValue){ console.log(labelObj.label); } //创建对象 var myObj={label:"come on"}; //调用函数 printLa原创 2015-06-25 15:08:02 · 4429 阅读 · 0 评论 -
Typescript的函数的使用
命名函数 function add(x:number,y:number):string{ return 'hello typescript'; } 匿名函数 var myAdd=function(x:number,y:number):string{ return 'hello typescript'; }指定函数的参数意义var myDoc:(name:string,age:原创 2015-06-26 13:24:41 · 1685 阅读 · 0 评论 -
Typescript的类的使用
类的创建 class Person{ name:string; age:number; //构造函数 constructor(name:string,age:number){ this.name=name; this.age=age; } print()原创 2015-06-26 18:04:09 · 1148 阅读 · 0 评论