提交 bdb8464f 编写于 作者: fxy060608's avatar fxy060608

Update literal.md

上级 bb7d473b
......@@ -188,9 +188,9 @@ console.log(userA)
注意花括号还有一个使用场景,被用于type时,是定义了一个自定义类型。下面的代码通过type关键字定义了一个 User类型,该自定义类型有2个属性,string类型的name和number类型的age。
```ts
type User{
name:string = ""
age:number = 0
type User = {
name:string
age:number
}
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册