简介 目录 评价 推荐
  • UFO2015 2020-07-11

    _ 误导,js 不存在 private


    截图
    2赞 · 1采集
  • UFO2015 2020-07-11

    TypeScript Types

    Any, Void, Never

    Interface, Tuple, Enum



    # TypeScript Types


    https://www.typescriptlang.org/docs/handbook/basic-types.html


    https://www.typescriptlang.org/docs/handbook/advanced-types.html


    ```ts


    Boolean

    Number

    String

    Array


    Tuple

    Enum

    Any

    Void


    Null and Undefined


    Never


    Object


    // Type assertions

    // A note about ‘let’



    ```


    ```ts

    Intersection Types


    Union Types


    Type Guards and Differentiating Types

      User-Defined Type Guards

        Using type predicates

        Using the in operator

      typeof type guards

      instanceof type guards


    Nullable types

      Optional parameters and properties

      Type guards and type assertions


    Type Aliases

      Interfaces vs. Type Aliases


    String Literal Types


    Numeric Literal Types


    Enum Member Types


    Discriminated Unions


    Exhaustiveness checking

      Polymorphic this types


    Index types

      Index types and index signatures


    Mapped types

      Inference from mapped types


    Conditional Types

      Distributive conditional types

      Type inference in conditional types

      Predefined conditional types


    ```


    https://www.typescriptlang.org/docs/handbook/utility-types.html


    ```ts

    Partial<T>

    Readonly<T>

    Record<K,T>

    Pick<T,K>

    Omit<T,K>

    Exclude<T,U>

    Extract<T,U>

    NonNullable<T>

    Parameters<T>

    ConstructorParameters<T>

    ReturnType<T>

    InstanceType<T>

    Required<T>

    ThisParameterType

    OmitThisParameter

    ThisType<T>



    ```


    截图
    1赞 · 0采集
  • OOLON_T 2019-05-25

    TS的特点:

    https://img3.mukewang.com/5ce942de00017f2809880502.jpg

    https://img4.mukewang.com/5ce942f40001963308470429.jpg

    https://img1.mukewang.com/5ce943230001f86108260439.jpg


    0赞 · 0采集
  • 23568 2018-12-19

    TS 常见类型

    Boolean Number String Array

    Tuple Enum interface class

    Any Void Null Undefined Never(某个函数不可返回)


    变量声明

    const/var/let 变量: 类型


    函数声明

    function 函数名(参数1: 类型1, 参数2: 类型2): 返回类型 {}


    箭头函数

    (参数1: 类型1, 参数2: 类型2):返回类型 => {}


    类成员的声明

    class 类名 {

        // 私有变量

        private _x: number;

        private _y: number;


        ...

    }


    未声明类型默认作为 any 类型


    声明类成员类型、方法/函数的参数类型和返回类型


    能明确推导时 局部变量/箭头函数 可以不申明类型


    0赞 · 0采集
  • 木木得木木 2018-07-25

    ts小结:

    截图
    0赞 · 0采集
  • 木木得木木 2018-07-25

    申明类型-函数

    截图
    0赞 · 0采集
  • 木木得木木 2018-07-25

    申明类型-变量/常量

    const 常量名:类型

    let 变量名:类型

    var 变量名:类型

    截图
    0赞 · 0采集
  • 木木得木木 2018-07-25

    TypeScript的常见类型

    截图
    0赞 · 0采集
  • 木木得木木 2018-07-25

    TypeScript在JavaScript里面独有的语法

    截图
    0赞 · 0采集
  • 平常不平淡 2018-07-15

    typescript的常见类型

    截图
    0赞 · 0采集
  • 无所畏惧小小小 2018-06-28

    mac下删除文件命令

    rm *.js -s
    rm **/*.js -s


    0赞 · 0采集
  • 边城 2018-01-31
    [代码](https://gitee.com/jamesfancy/sudoku)
    4赞 · 1采集
  • _neo_ 2018-01-14
    jlkjlkkl
    截图
    0赞 · 0采集
  • objectivezhou 2017-12-28
    申明函数
    截图
    0赞 · 0采集
  • 尼古拉斯李铁蛋 2017-12-15
    我的笔记
    截图
    0赞 · 0采集
  • 前端爱你所难 2017-12-10
    一起学习交流的html5技术交流,解答、群 618522268群文件上传了很多的项目实战,大家可以练练手
    截图
    0赞 · 0采集
  • 前端爱你所难 2017-12-10
    一起学习交流的html5技术交流,解答、群 618522268群文件上传了很多的项目实战,大家可以练练手
    截图
    0赞 · 0采集
  • 挤潮 2017-11-27
    hahahaha
    0赞 · 0采集
  • qq_90年的雪飘_0 2017-11-16
    数独.
    截图
    0赞 · 1采集
  • 慕斯7528646 2017-11-09
    为玩儿若
    0赞 · 0采集
  • Ariel11 2017-11-06
    数独
    截图
    0赞 · 1采集
  • Ariel11 2017-11-06
    数独
    截图
    0赞 · 1采集
  • 慕哥5055285 2017-11-04
    视频不错
    0赞 · 0采集
  • 边城 2017-11-02
    欢迎关注我的订阅号“边城客栈”,平均大约每两周会推荐一次1~3篇原创或翻译的开发技术类文章,以 JS/TS 技术为主,也有一些后端技术(C#.NET)和算法等内容
    4赞 · 0采集
  • 边城 2017-11-02
    [从JS到TS开发数独游戏(JS版)](http://www.imooc.com/learn/899) 是这部课程的前篇,它讲述了用数独游戏的设计、界面制作和用 JavaScript 实现的全部过程。
    3赞 · 0采集
  • 平凡的世界4290559 2017-10-27
    烦烦烦烦烦烦烦烦烦
    0赞 · 0采集
  • 边城 2017-10-26
    由于 npm 会自动将 node_modules/.bin 加入 PATH,所以这里可以直接配置运行 gulp,即: "gulp": "gulp"
    0赞 · 0采集
数据加载中...
开始学习 免费