Giter Club home page Giter Club logo

ron0115.github.io's Introduction

ron0115.github.io's People

Contributors

ron0115 avatar

ron0115.github.io's Issues

TS泛型的一些应用

TS泛型的一些应用 | Ron0115

背景最近用 TS 重写了部分工具函数,其中用到了泛型,故作分享 泛型泛型(Generics)是指在定义函数、接口或类的时候,不预先指定具体的类型,而在使用的时候再指定类型的一种特性。 简单例子首先,我们来实现一个函数 createArray,它可以创建一个指定长度的数组,同时将每一项都填充一个默认值: 123function createArray(length: number, value: a

http://ron0115.github.io/2019/11/25/%E6%8A%80%E6%9C%AF%E7%AC%94%E8%AE%B0-2019-11-25-TS%E6%B3%9B%E5%9E%8B%E7%9A%84%E4%B8%80%E4%BA%9B%E5%BA%94%E7%94%A8/

2019/11/25/%E6%8A%80%E6%9C%AF%E7%AC%94%E8%AE%B0-2019-11-25-TS%E6%B3%9B%E5%9E%8B%E7%9A%84%E4%B8%80%E4%BA%9B%E5%BA%94%E7%94%A8/

TS泛型的一些应用 | Ron0115

背景最近用 TS 重写了部分工具函数,其中用到了泛型,故作分享 泛型泛型(Generics)是指在定义函数、接口或类的时候,不预先指定具体的类型,而在使用的时候再指定类型的一种特性。 简单例子首先,我们来实现一个函数 createArray,它可以创建一个指定长度的数组,同时将每一项都填充一个默认值: 123function createArray(length: number, value: a

http://ron0115.github.io/2019/11/25/%E6%8A%80%E6%9C%AF%E7%AC%94%E8%AE%B0-2019-11-25-TS%E6%B3%9B%E5%9E%8B%E7%9A%84%E4%B8%80%E4%BA%9B%E5%BA%94%E7%94%A8/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.