What are the JS functions

Source: Internet
Author: User
Tags floor function local time mathematical functions natural logarithm

JavaScript built-in functions (built-in functions, built-in keywords)
  
 JS's built-in object is JS, which encapsulates a number of common methods. Common JS built-in objects are: String,date,array,math, etc.
 

JS built-in function is the browser kernel comes with, without any function library introduction can be directly used by the function. JavaScript built-in functions can be divided into five categories:
1. General functions
2. Array functions
3. Date function
4. Mathematical Functions
5. String functions

First Class: General functions
The following 9 functions are included:
(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 numeric form of a character.
(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.

Class II: Array Functions
The following 4 functions are included:
(1) Join function: Converts and joins all elements in an array to a string.
(2) langth function: Returns the length of the array.
(3) Reverse function: Reverses the order of the array elements.
(4) Sort function: Reorder the array elements.

Class III: Date Functions
The following 20 functions are included:
(1) getdate function: Returns the "Day" part 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, ..., 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. See the example above.
(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. See the previous example.
(6) getseconds function: Returns the "second" part of the date with a value of 0~59. See the previous example.
(7) gettime function: Returns the system time.
(8) getTimezoneOffset function: Returns the difference in this area (local time and GMT Greenwich Mean Time), in minutes.
(9) getyear function: Returns the "year" part of the date. The return value is based on a 1900-year base, for example, 1999 is 99.
Parse Function: Returns the number of milliseconds (local time) that was counted from zero January 1, 1970.
(one) setdate function: The "day" portion of the set date, with a value of 0~31.
sethours function: The "hours" section of the set date, with a value of 0~23.
setminutes function: The "Minutes" section of the set date, with a value of 0~59.
setmonth function: Sets the month portion of the date, and the value is 0~11. 0 of them represent January, ..., 11 means December.
() setseconds function: The "Seconds" section of the set date, and the value is 0~59.
() settime function: Set the time. The time value is the number of milliseconds since January 1, 1970 when the integer count is zero.
() setyear function: The "Year" section of the set date.
togmtstring Function: The conversion date becomes a string, GMT Greenwich Standard Time.
() setlocalestring function: Converts the date into a string, for local time.
UTC Function: Returns the number of milliseconds from January 1, 1970 to the full count, measured in GMT Greenwich Mean time.

class Fourth: Mathematical Functions
The function has the following 18:
(1) ABS function: Math.Abs (the same as below), returns the absolute value of a number.
(2) ACOs function: Returns the inverse cosine of a number with a result of 0~π radians (radians).
(3) ASIN function: Returns the inverse chord value of a number, resulting in-Π/2~Π/2 radians.
(4) Atan function: Returns the inverse tangent of a number, resulting in-Π/2~Π/2 radians.
(5) atan2 function: Returns the polar coordinate angle value of a coordinate.
(6) Ceil function: Returns the smallest integer value (greater than or equal to) of a number.
(7) Cos function: Returns the cosine of a number with the result of -1~1.
(8) Exp function: Returns the value of the exponent of E (natural logarithm).
(9) Floor function: Returns the maximum integer value (less than or equal to) of a number.
log function: A natural logarithm function that returns the natural logarithm (e) value of a number.
(one) Max function: Returns the maximum value of two digits.
min Function: Returns the minimum value of two digits.
POW function: Returns the value of a number.
Random function: Returns a 0~1 value.
round function: Returns the rounded value of a number with an integer type.
sin function: Returns the sine of a number with the result of -1~1.
sqrt function: Returns the square root value of a number.
Tan function: Returns the tangent of a number.

class Fifth: String Functions
The following 20 functions are included:
(1) Anchor function: Generates a link point (anchor) for use as a hyperlink. The Anchor function sets the name of the <a name...> link, and the other function link sets the URL address of the <a href=...>.
(2) BIG function: Add the font to a number, the same as the <BIG>...</BIG> label results.
(3) BLINK function: Causes the string to blink, the same as the <BLINK>...</BLINK> label result.
(4) Bold function: Make the font bold, the same as the <B>...</B> label results.
(5) Charat function: Returns a character specified in the string.
(6) Fixed function: Sets the font to a fixed-width font, the same as the <TT>...</TT> label result.
(7) FontColor function: Sets the font color, the same as the <font color=color> label results.
(8) fontsize function: Sets the font size, the same as the <font size=n> label results.
(9) indexof function: Returns the index of the first lookup in a string, starting from the left.
() italics function: Make the font italic, same as the <I>...</I> label result.
(one) LastIndexOf function: Returns the index of the first lookup in a string, starting from the right.
length function: Returns the lengths of the strings. (without parentheses)
link function: Generates a hyperlink equivalent to the URL address of the set <a href=...>.
SMALL function: Decrease the font size by one number and the same as the <SMALL>...</SMALL> label result.
STRIKE function: Add a horizontal line to the middle of the text, the same as the <STRIKE>...</STRIKE> label result.
() Sub function: The display string is the subscript (subscript).
substring function: Returns the number of characters specified in the string.
sup Function: The display string is the superscript word (superscript).
() toLowerCase function: Converts a string to lowercase.
() touppercase function: Converts a string to uppercase.

Reference:
Https://wenku.baidu.com/view/82b59c44f7ec4afe04a1df7c.html
Https://zhidao.baidu.com/question/568123797.html

What are the JS functions

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.