Classification of built-in functions in js
This article focuses on "the classification of js built-in functions". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the classification of js built-in functions.
Js built-in functions are built into the browser kernel and can be used directly without any library introduction. Javascript built-in functions can be divided into five categories:
1. General function
2. Array function
3. Date function
4. Mathematical function
5. String function
The first category: regular functions
Includes the following nine functions:
(1) alert function: displays a warning dialog box, including an OK button.
(2) confirm function: displays a confirmation dialog box, including OK and Cancel buttons.
(3) escape function: converts characters into Unicode codes.
(4) eval function: the result of evaluating the expression.
(5) isNaN function: test whether (true) or (false) is not a number.
(6) parseFloat function: converts a string into a symbol point number.
(7) parseInt function: converts the string to integer numeric form (decimal can be specified).
(8) prompt function: displays an input dialog box that prompts you to wait for user input.
The second category: array functions
Includes the following four functions:
(1) join function: converts and concatenates all elements in the array into a string.
(2) langth function: returns the length of the array.
(3) reverse function: reverses the order of array elements.
(4) sort function: reorder array elements.
The third category: date function
Includes the following 20 functions:
(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 represents Monday, and 6 represents Saturday.
(3) getHours function: returns the "hour" part of the date, with a value of 0023.
(4) getMinutes function: returns the "minute" part of the date, with a value of 0059. See the above example.
(5) getMonth function: returns the "month" part of the date, with a value of 011. Where 0 is January, 2 is March, and 11 is December. See the previous example.
(6) getSeconds function: returns the "second" part of the date, with a value of 0059. See the previous example.
(7) getTime function: returns the system time.
(8) getTimezoneOffset function: returns the time difference of this area (the regional time difference between 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 1900, for example, 99 in 1999.
(10) parse function: returns the number of milliseconds (local time) from 00:00 on January 1st, 1970.
(11) setDate function: sets the "day" part of the date, with a value of 0,31.
(12) setHours function: sets the "hour" part of the date, with a value of 0,23.
(13) setMinutes function: set the "minutes" part of the date, with a value of 0059.
(14) setMonth function: sets the "month" part of the date, with a value of 011. Where 0 means January, and 11 means December.
(15) setSeconds function: sets the "second" part of the date, with a value of 0059.
(16) setTime function: set the time. The time value is the number of milliseconds from 00:00 on January 1, 1970.
(17) setYear function: the "year" part of the set date.
(18) toGMTString function: converts the date into a string, which is GMT Greenwich mean time.
(19) setLocaleString function: converts the date into a string, local time.
(20) UTC function: returns the number of milliseconds from 00:00 on January 1, 1970, calculated in GMT Greenwich mean time.
The fourth category: mathematical functions
There are 18 functions:
(1) abs function: that is, Math.abs (the same below), which returns the absolute value of a number.
(2) acos function: returns the inverse cosine of a number, and the result is 0 ~ π radians (radians).
(3) asin function: returns the arcsine of a number, and the result is-π / 2 ~ π / 2 radians.
(4) atan function: returns the inverse tangent of a number, and the result is-π / 2 ~ π / 2 radians.
(5) atan2 function: returns the polar angle value of a coordinate.
(6) ceil function: returns the minimum integer value of a number (greater than or equal to).
(7) cos function: returns the cosine of a number, and the result is-1x 1.
(8) exp function: returns the multiplier value of e (natural logarithm).
(9) floor function: returns the maximum integer value of a number (less than or equal to).
(10) log function: a natural logarithmic function that returns the natural logarithm (e) of a number.
(11) max function: returns the maximum of two numbers.
(12) min function: returns the minimum value of two numbers.
(13) pow function: returns the multiplier value of a number.
(14) random function: returns a random value of 0: 1.
(15) round function: returns the rounded value of a number whose type is an integer.
(16) sin function: returns the sine of a number, and the result is-1 to 1.
(17) sqrt function: returns the square root of a number.
(18) tan function: returns the tangent of a number.
The fifth category: string functions
Includes the following 20 functions:
(1) anchor function: generates a link point (anchor) for hyperlink. The name of the link point set by the anchor function and the URL address set by another function link.
(2) big function: add the font to the first number, and. The label results are the same.
(3) blink function: make the string flicker, and. The label results are the same.
(4) bold function: make the font bold, and. The label results are the same.
(5) charAt function: returns a character specified in the string.
(6) fixed function: set the font to a fixed width font, and. The label results are the same.
(7) fontcolor function: sets the font color, which is the same as the label result.
(8) fontsize function: sets the font size, which is the same as the result of the label.
(9) indexOf function: returns the first subscript index found in the string, starting from the left.
(10) italics function: make the font italic, and. The label results are the same.
(11) lastIndexOf function: returns the first subscript index found in the string, starting on the right.
(12) length function: returns the length of the string. (no parentheses)
(13) link function: generates a hyperlink, which is equivalent to the set URL address.
(14) small function: reduce the font by one number, and. The label results are the same.
(15) strike function: add a horizontal line in the middle of the text, and. The label results are the same.
(16) sub function: displays the string as subscript (subscript).
(17) substring function: returns a few characters specified in the string.
(18) sup function: displays the string as superscript (superscript).
(19) toLowerCase function: converts a string to lowercase.
(20) toUpperCase function: converts a string to uppercase.
At this point, I believe you have a deeper understanding of the "classification of js built-in functions". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!