Home > Web Front-end > JS Tutorial > body text

toString() method of JavaScript Number object_javascript skills

WBOY
Release: 2016-05-16 15:24:43
Original
1156 people have browsed it

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());
Copy after login

Output result: 3.

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template