GithubHelp home page GithubHelp logo

yangxin1994 / tools-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samuel-xiangpeng/tools

0.0 0.0 0.0 101 KB

自定义实现包括函数相关、数组相关、对象相关,字符串相关的工具函数, 类似流行的工具函数库lodash;还有手写ajax请求、Promise。极大提升对原生JS核心技术的理解和编码能力!

Home Page: https://tools-khaki-one.vercel.app/#/

JavaScript 96.16% HTML 3.84%

tools-1's Introduction

开始

在线文档 在线文档(vercel)

An awesome project.🤣

项目总览

本项目只要是熟悉javascript的语法以及一些基本的api的使用,然后自己去实现,加深自己对api的理解。只要实现以下的api.

  1. 函数方面(函数的节流和防抖)
  2. 数组方面
    • 数组的基本api(forEach, map, filter, reduce, some, every)
    • 数组的去重算法
    • 数组的扁平化处理
    • 数组的分区
  3. 对象方面
    • 对象的基本api(instanceof, intance)
  4. 字符串方面
  5. 自定义实现promise
  6. 自定义实现消息订阅与发布

快速上手

npm安装

npm install ytoolsjs

yarn安装

yarn add ytoolsjs

网页中引入并使用

<script src="./node_modules/ytoolsjs/dist/ytools.js"></script>
<script>
  new y._Promise((resolve, reject) => {
    resolve('测试')
  })
</script>

模块化引入并使用

// 使用ESM引入
import {_Promise} from 'ytoolsjs'
new _Promise((resolve, reject) => {
    resolve('测试')
  })

// 使用commonjs引入
const {_Promise} = require('ytoolsjs')
new _Promise((resolve, reject) => {
    resolve('测试')
  })

tools-1's People

Contributors

samuel-xiangpeng avatar

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.