简体   繁体   English

typescript 中的“>”是什么意思?

[英]What does “>” mean in typescript?

I saw code like this:我看到这样的代码:

let items: Array<{
  name: string,
  value: string
} | null> | null 

What does null> mean in this code?这段代码中的null>是什么意思?

This means the array could hold 2 types.这意味着该数组可以容纳 2 种类型。 Either holds the specified object containing:要么持有指定的 object 包含:

name: string,
value: string

or it could hold null values.或者它可以保存null值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM