Home >Web Front-end >JS Tutorial >Detailed explanation of the toString() method of JavaScript's Number object

Detailed explanation of the toString() method of JavaScript's Number object

怪我咯
怪我咯Original
2017-07-04 15:19:261889browse

The

toString() method can convert the Number object into a string and return this string. This article will introduce to you the Number object of JavaScript toString() method, friends who are interested in knowledge about javascript objects methods, let’s learn together

The definition and usage of toString() method:

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:

The code is as follows:

NumberObject.toString(radix)

Parameter list:

##radixOptional. Specifies the base in which the number is represented, making it an
Parameters ##Description
integer between 2 and 36. If this parameter is omitted, base 10 is used. Note, however, that the ECMAScript standard allows implementations to return an arbitrary value if the parameter is a value other than 10.
Example code:

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

The above is the detailed content of Detailed explanation of the toString() method of JavaScript's Number object. For more information, please follow other related articles on the PHP Chinese website!

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