美文网首页
react + ts视频

react + ts视频

作者: Small_Song | 来源:发表于2021-04-27 14:26 被阅读0次

    元祖:

    1.长度固定
    2.类型可以不一样(数组里面的每项都一样)

    枚举enum

    enum gender {
      boy, 
      girl
    }
    等于
    let gender = {
      0: boy,
      1: girl,
      'boy': 0,
      'girl': 1
    }
    

    nerver

    function 返回nerver的两种情况:

    1. 函数中永远会抛出错误,无法正常结束
    2. 函数中死循环

    &交叉类型:两个类型里面的属性的并集

    通过[ ]来获取一个类型的子类型

    keyof的用法

    映射类型:将必须属性改成可选属性 - Partial

    Required: 将可选变成必选

    相关文章

      网友评论

          本文标题:react + ts视频

          本文链接:https://www.haomeiwen.com/subject/jxkvfltx.html