JS (2) numeric and string objects, and js numeric object strings
I. js Functions
It is easy to confuse because many things are learned. It is impossible to remember them one by one. Here, we will be able to quickly review them when using them in the future.
Index-number.js
/*** Display numeric object */function myFunction () {var x1 = 3.14; // fractional var x2 = 11; // integer var x3 = 14e5; // big numeric var x4 = 0237; // octal var x5 = 0x12f; // hexadecimal var y = 0.1 + 0.2; var str = "x1: "+ x1 +" <br/> x2: "+ x2 +" <br/> x3: "+ x3 +" <br/> x4: "+ x4 +" <br/> x5: "+ x5; document. write (str + "<br/>"); document. write (y);}/*** display String object */function myFunction2 () {var str = "<p> This is the text content of the js object </p> "; var str2 = "Black"; var str3 = "this is the text content of the js object" document. write (str. italics (); // The text is italic document. write (str. fontcolor ("# ff0000"); // The text color is red. Pay attention to the case of document. write (str. link ("http://www.baidu.com"); // click the link document to jump to the content. write (str. bold (); // The text is in bold document. write (str2.toLocaleLowerCase (); // lowercase document. write (str2.toUpperCase (); // uppercase document. write (str. fontcolor ("red "). fontsize (20); // change the text color and font size at the same time. document. write (str3.fontsize (20) + str2.sub () + str3.fontsize (20) + str2.sup (); // superscript and subscript document. write (str. replace ("js", "JavaScript"); // replace}