/** * Created by ufo9631 on 2017/5/17. */ var myArr = [1, 2, 3, 4, 5]; myArr.desc = "five number"; myArr.forEach(function (value) { return console.log... ...
分类:
其他好文 时间:
2017-11-15 23:32:50
阅读次数:
194
/** * Created by ufo9631 on 2017/5/17. */ //箭头表达式 消除javascrpt 带来的this问题 var sum = function (arg1, arg2) { return arg1 + arg2; }; //箭头表达式,声明匿名函数 var su... ...
分类:
其他好文 时间:
2017-11-15 23:30:31
阅读次数:
130
/** * Created by ufo9631 on 2017/5/16. */ /*函数新特性*/ function func1() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i - 0] = a... ...
分类:
其他好文 时间:
2017-11-15 23:30:23
阅读次数:
131
The keyof operator produces a union type of all known, public property names of a given type. You can use it together with lookup types (aka indexed a ...
分类:
其他好文 时间:
2017-11-13 23:24:18
阅读次数:
205
TypeScript’s discriminated union types (aka tagged union types) allow you to model a finite set of alternative object shapes in the type system. The c ...
分类:
其他好文 时间:
2017-11-13 19:58:54
阅读次数:
180
For example we have an object: We shallow copy it: Verify that shallowCopy is not todo: Change text prop of shallowCopy to somethingelse: But if we wa ...
分类:
其他好文 时间:
2017-11-13 19:47:53
阅读次数:
149
Some functions may have different return types depending on the types of the arguments with which they’re invoked. Using TypeScript’s function overloa ...
分类:
其他好文 时间:
2017-11-10 20:08:28
阅读次数:
208
一.npm install -g typescript 全局安装TypeScript 二.使用Vs Code打开已创建的文件夹,使用快捷键Ctrl+~启动终端输入命令 tsc --init 创建tscconfig.json 三.新建文件HelloWorld.ts 四. 使用快捷键ctrl+shift ...
分类:
其他好文 时间:
2017-11-10 18:46:17
阅读次数:
174
TypeScript 2.0 introduced a new primitive type called never, the type of values that never occur. It helps model the completion behavior of functions ...
分类:
其他好文 时间:
2017-11-10 00:21:09
阅读次数:
125
ypeScript 2.2 introduced the object, a type that represents any non-primitive type. It can be used to more accurately type methods such as Object.crea ...
分类:
其他好文 时间:
2017-11-09 22:36:27
阅读次数:
221