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

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

怪我咯
Release: 2017-07-04 15:19:26
Original
1715 people have browsed it

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

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

Related labels:
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!