Number and String

# (1) Number
can be created by new Number () object
var y = new Number (125) ;
at this time show that he is a typeof y Object
toFixed can return a number of decimal expression is displayed after the decimal point a few (?)? decimals
toExponential expression returns a LCyT
ValueOf returns a digital object elementary type


# (2) String objects
with similar Number, can create a String String object via new new ()
the charAt Returns the specified character position
charCodeAt return Unicode character code corresponding to the designated location
concat string for splicing
localeCompare compare two strings are the same, i.e. 0 represent the same, different non-0 indicates
that all return string type methods, are substantially return type string object rather than
the other and functions substantially similar to Java
split according delimiter string into an array .
NOTE: The second optional parameter indicating the length of an array of return
value of a string of x: Hello This Is JavaScript
separated split by a space ( ""), the array element Hello, This, Is, JavaScript
separated by split space ( "", 2) to give the array and retaining only the first two Hello, This

Guess you like

Origin www.cnblogs.com/whydbk/p/12666627.html