Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 794 Bytes

2016-12-12.md

File metadata and controls

26 lines (18 loc) · 794 Bytes

JS 查漏 - 内置函数 - Number

Properties

  • Number.EPSILON 两个数字间最小间隔
  • Number.MAX_SAFE_INTEGER (2**53 - 1)
  • Number.MIN_SAFE_INTEGER (-(2**53-1))
  • Number.MIN_VALUE 最小的正数,无限趋近于零
  • Number.NEGATIVE_INFINITY 负无穷
  • Number.POSITIVE_INFINITY 正无穷
  • Number.prototype 用于给数字对象添加额外方法

Methods

  • Number.isFinite()

instances Methods

  • Number.prototype.toExponential([fractionDigits]) fractionDigits 0-20 自然指数表示
  • Number.prototype.toLocaleString() 具有可读性展示
  • Number.prototype.toFixed([digits]) digits 0-20 保留几位小数
  • Number.prototype.toString([radix]) radix 进制数 2-36
  • Number.prototype.toPrecision([precision]) precision 1-100 整体保留几位数

1484 days left