Commit 25659120 by Eddy Guo

test -i

parent c1ef6fa7
......@@ -174,5 +174,21 @@ handleEvent(ele, 'click');
## enum
```js
enum Days {a, b, c, d, e, f, g}
enum Days {a, b, c, d, e, f, g};
```
## 泛型
```js
function createArray<T>(length: number, value: T): Array<T> {
let result = [];
for (let i = 0; i < length; i++) {
result[i] = value;
}
return result;
}
createArray<string>(3, 'x'); // ['x', 'x', 'x']
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment