Giter Site home page Giter Site logo

gammatools's Introduction

GammaTools

Tools for JavaScript base on TypeScript

Useages
  • ES

    • import { } from 'gammatools'
  • Node

    • const { } = require('gammatools')
Methods

获取随机布尔值

  • 方法名: randomBoolean
  • 参数: 空
  • 返回值: Boolean

检查传入的日期是否为工作日

  • 方法名: isWeekday
  • 参数: Date
  • 返回值: Boolean

反转字符串

  • 方法名: reverse
  • 参数: String
  • 返回值: Boolean

检查是否为偶数

  • 方法名: isEven
  • 参数: Number
  • 返回值: Boolean

从 Date() 中获取时间

  • 方法名: timeFromDate
  • 参数: Date
  • 返回值: String

保留小数的 n 位数,非四舍五入

  • 方法名: toFixed
  • 参数: Number, fixed(小数保留位数)
  • 返回值: String

判断当前用户是否为苹果设备

  • 方法名: isAppleDevice
  • 参数: 空
  • 返回值: Boolean

滚动到页面顶部

  • 方法名: goToTop
  • 参数: 空
  • 返回值: 无

获取参数平均值

  • 方法名: goToTop
  • 参数: Number[]
  • 返回值: Number

摄氏度转华氏度

  • 方法名: celsiusToFahrenheit
  • 参数: Number(摄氏度)
  • 返回值: Number(华氏度)

华氏度转摄氏度

  • 方法名: fahrenheitToCelsius
  • 参数: Number(华氏度)
  • 返回值: Number(摄氏度)
DataStructure
栈 Stack

构造函数

  • 参数: Array(可选)
  • 示例: let stack = new Stack()

获取栈元素长度

  • 方法名: getSize
  • 参数: 空
  • 返回值: Number

判断栈是否为空

  • 方法名: isEmpty
  • 参数: 空
  • 返回值: Boolean

入栈

  • 方法名: push
  • 参数: 泛型
  • 返回值: Void

出栈

  • 方法名: pop
  • 参数: 空
  • 返回值: 泛型

查看栈顶元素

  • 方法名: peek
  • 参数: 空
  • 返回值: 泛型

格式化输出

  • 方法名: toString
  • 参数: 空
  • 返回值: String

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.