×
参考手册概览

JavaScript 对象

JavaScript Array 对象手册 JavaScript Array 对象JavaScript Boolean 对象JavaScript Date 对象JavaScript Math 对象JavaScript Number 对象JavaScript String 对象JavaScript RegExp 对象JavaScript 全局属性/函数JavaScript 运算符

Browser 对象

Window 对象Navigator 对象Screen 对象History 对象Location 对象

DOM 对象

HTML DOM DocumentHTML DOM 元素对象HTML DOM 属性对象HTML DOM 事件对象

HTML 对象

<a><area><audio><base><blockquote><body><button><canvas><col><colgroup><datalist><del><details><dialog><embed><fieldset><form><iframe><frameset ><img><ins><input> - button<input> - checkbox<input> - color<input> - date<input> - datetime<input> - datetime-local<input> - email<input> - file<input> - hidden<input> - image<input> - month<input> - number<input> - range<input> - password<input> - radio<input> - reset<input> - search<input> - submit<input> - text<input> - time<input> - url<input> - week<keygen><link><label><legend><li><map><menu><menuItem><meta><meter><object><ol><optgroup><option><param><progress><q><script><select><source><style><table><td><th><tr><textarea><title><time><track><video>

JavaScript Number 对象


Number 对象

Number 对象是原始数值的包装对象。

Number 创建方式 new Number()。

语法

var num = new Number(value);

注意: 如果一个参数值不能转换为一个数字将返回 NaN (非数字值)。


Number 对象属性

属性 描述
constructor 返回对创建此对象的 Number 函数的引用。
MAX_VALUE 可表示的最大的数。
MIN_VALUE 可表示的最小的数。
NEGATIVE_INFINITY 负无穷大,溢出时返回该值。
NaN 非数字值。
POSITIVE_INFINITY 正无穷大,溢出时返回该值。
prototype 允许您有能力向对象添加属性和方法。

Number 对象方法

方法 描述
toExponential(x) 把对象的值转换为指数计数法。
toFixed(x) 把数字转换为字符串,结果的小数点后有指定位数的数字。
toPrecision(x) 把数字格式化为指定的长度。
toString() 把数字转换为字符串,使用指定的基数。
valueOf() 返回一个 Number 对象的基本数字值。

分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)