Home  >  Article  >  Web Front-end  >  toString() method of JavaScript Number object_javascript skills

toString() method of JavaScript Number object_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:24:431137browse

Definition and usage of toString() method:

The toString() method can convert the Number object into a string and return this string.

Click to view more methods and properties of related Number objects (classes).

Grammar structure:

Copy code The code is as follows:

NumberObject.toString(radix)

Parameter list:

参数 描述
radix 可选。规定表示数字的基数,使2 ~ 36 之间的整数。若省略该参数,则使用基数10。但是要注意,如果该参数是10以外的其他值,则ECMAScript标准允许实现返回任意值。

Example code:

var a=new Number(3);
console.log(a.toString());

Output result: 3.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn