Javascript Common function "2"

Source: Internet
Author: User
Tags javascript array

1. General functions
JavaScript general functions include the following 9 functions:
(1) Alert function: Displays a warning dialog box, including an OK button.
(2) Confirm function: Displays a confirmation dialog box, including OK, Cancel button.
(3) Escape function: Converts a character to a Unicode code.
(4) Eval function: Evaluates the result of an expression.
(5) isNaN function: The test is (true) No (false) is not a number.
(6) parsefloat function: Converts a string into a floating-point number form.
(7) parseint function: Converts a string into an integer number form (which can be specified as a binary).
(8) Prompt function: Displays an input dialog box prompting for user input. For example:
(9) Unescape function: Decodes characters encoded by the escape function.

2. Array functions
The JavaScript array function consists of the following 4 functions:
(1) Join function: Converts and joins all elements in an array to a string.
A = new Array (0,1,2,3,4);
b = A.join ("-");//delimiter
Returns the b== "0-1-2-3-4"
(2) Length function: Returns the lengths of the array. Cases:
A = new Array (0,1,2,3,4);
L = a.length;
L==5
(3) Reverse function: Reverses the order of the array elements. Cases:
A = new Array (0,1,2,3,4);
L = A.reverse ();
return (L);
(4) Sort function: Reorder the array elements. Cases:
A = new Array ("X", "Y", "D", "Z", "V", "M", "R");
L = A.sort ();

3. Date function
The JavaScript date function consists of the following 20 functions:
(1) getdate function: Returns the day portion of the date, with a value of 1~31.
(2) Getday function: Returns the day of the week with a value of 0~6, where 0 represents Sunday, 1 means Monday, ..., and 6 means Saturday.
(3) gethours function: Returns the "hour" portion of the date, with a value of 0~23.
(4) Getminutes function: Returns the "minute" part of the date with a value of 0~59.
(5) GetMonth function: Returns the month portion of the date, with a value of 0~11. 0 means January, 2 means March, ..., and 11 means December.
(6) Getseconds function: Returns the "second" part of the date with a value of 0~59.
(7) GetTime function: Returns the system time.
(8) getTimezoneOffset function: Returns the difference in this area (local time and Greenwich Mean Time), in minutes.

4. Other functions
(1) Big function: Add the font to a number, the same as the label result.
(2) Blink function: Causes the string to blink, the same as the label result.
(3) Bold function: Make the font bold, the same as the label result.
(4) Charat function: Returns a character specified in the string.
(5) Fixed function: Sets the font to a fixed-width font, the same as the label result.
(6) FontColor function: Sets the font color, the same as the label result.
(7) Fontsi

Javascript Common function "2"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.