In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "es6 how to turn numbers into strings", so the editor summarizes the following contents, detailed contents, clear steps, and certain reference value. I hope you can get something after reading this article. Let's take a look at this "es6 how to turn numbers into strings" article.
Conversion method: 1, use "+" to concatenate an empty character to the number, syntax "number +"; 2, use String (), you can convert the value of the object into a string, syntax "String (numeric object)"; 3, with toString (), you can return the string representation of the number, syntax "numeric .toString ()".
The operating environment of this tutorial: windows7 system, ECMAScript version 6, Dell G3 computer.
The method of converting a number into a string by es6
1. Concatenate a blank character to the number
Var a = 1 + "; alert (typeof a); / / string
2. Use the String method
The String () function converts the value of an object to a string.
Var a = 1scape console.log (typeof a); / / numbervar b = String (a); console.log (typeof b); / / string
3. Use the toString () method
The toString () method converts a number to a string and returns a string representation of the number.
Var a = 1scape console.log (typeof a); / / numbervar b = a.toString (); console.log (typeof b); / / string
The above is about the content of this article on "how es6 converts numbers into strings". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.