Home > Web Front-end > JS Tutorial > javascript function cheat sheet_basic knowledge

javascript function cheat sheet_basic knowledge

WBOY
Release: 2016-05-16 18:35:15
Original
1283 people have browsed it

The abs method returns the absolute value of a number.
acos method returns the arc cosine of a number.
anchor method adds an HTML anchor with NAME attribute to both ends of the specified text of the object.
asin method returns the arcsine of a number.
atan method returns the arc tangent of a number.
atan2 method Returns the angle (in radians) from the X-axis to the point (y, x).
atEnd method Returns a Boolean value indicating whether the enumeration operator is at the end of the set. The
big method adds HTML tags at both ends of the text of the String object. The
blink method adds the HTML tag to both ends of the text in a String object. The
bold method adds the HTML tag to both ends of the text in a String object.
ceil method Returns the smallest integer greater than or equal to its numeric argument.
charAt method returns the character at the specified index.
charCodeAt method returns the Unicode encoding of the specified character.
compile method Compiles a regular expression into an internal format.
The concat method (Array) returns a new array composed of the combination of two arrays.
concat method (String) Returns a String object containing the concatenation of the given two strings.
cos method returns the cosine of a number.
dimensions method Returns the dimensions of the VBArray.
escape method Encodes a String object so that it can be read on all computers. The
eval method evaluates JScript code and then executes it.
The exec method performs a match search in the specified string.
exp method returns e (the base of natural logarithms) raised to the power. The
fixed method adds the HTML tag to both ends of the text in the String object.
floor method Returns the largest integer less than or equal to its numeric argument. The
fontcolor method adds the HTML tag with the COLOR attribute to both ends of the text in the String object. The
fontsize method adds HTML tags with the SIZE attribute to both ends of the text in the String object.
fromCharCode method returns a string of Unicode character values.
getDate method returns the month and day value of a Date object using local time.
getDay method returns the day of the week of a Date object using local time.
getFullYear method returns the year of a Date object using local time.
getHours method returns the hour value of a Date object using local time.
getItem method returns the item at the specified position.
getMilliseconds method returns the millisecond value of a Date object using local time.
getMinutes method returns the minutes value of a Date object using local time.
getMonth method returns the month of the Date object using local time.
getSeconds method returns the seconds of a Date object using local time.
getTime method returns the time in the Date object.
getTimezoneOffset method Returns the difference (in minutes) between the host's time and Universal Coordinated Time (UTC).
The getUTCDate method returns the date value of a Date object using Universal Coordinated Time (UTC).
getUTCDay method returns the day of the week of a Date object using Coordinated Universal Time (UTC).
getUTCFulYear method returns the year of a Date object using Coordinated Universal Time (UTC).
The getUTCHours method returns the hours of a Date object using Coordinated Universal Time (UTC).
getUTCMilliseconds method returns the number of milliseconds in a Date object using Universal Coordinated Time (UTC).
getUTCMinutes method returns the minutes of a Date object using Coordinated Universal Time (UTC).
The getUTCMonth method returns the month value of a Date object using Universal Coordinated Time (UTC).
getUTCSeconds method returns the number of seconds in a Date object using Universal Coordinated Time (UTC).
getVarDate method returns VT_DATE in Date object.
getYear method returns the year in the Date object.
indexOf method returns the character position of the first occurrence of the substring in the String object.
isFinite method returns a Boolean value indicating whether a given number is finite.
isNaN method Returns a Boolean value indicating whether a value is a reserved value NaN (not a number). The
italics method adds the HTML tag to both ends of the text in a String object.
item method returns the current item in the collection.
join method returns a String object joined together by all elements in the array.
lastIndexOf method returns the last occurrence of the substring in the String object.
lbound method Returns the minimum index value used for the specified dimension in the VBArray.
link method Adds HTML anchors with HREF attributes to both ends of text in a String object.
log method returns the natural logarithm of a certain number. The
match method searches a string using the given regular expression object and returns the result as an array.
max method Returns the larger of the two given expressions. The
min method returns the smaller of the two given numbers.
moveFirst method sets the current item in the collection to the first item.
moveNext method Sets the current item to the next item in the collection. The
parse method parses a string containing a date and returns the number of milliseconds between the date and midnight on January 1, 1970.
The parseFloat method returns a floating point number converted from a string.
parseInt method returns an integer converted from a string.
pow method returns the value of a base expression raised to a specified power.
random method returns a pseudo-random number between 0 and 1.
replace method returns a copy of the string after text replacement based on the regular expression.
reverse method returns an Array object with elements in reverse order.
round method Rounds a specified numeric expression to the nearest integer and returns it.
search method Returns the position of the first substring that matches the regular expression search content.
setDate method sets the numeric date of a Date object using local time.
setFullYear method sets the year of a Date object using local time.
setHours method sets the hour value of a Date object using local time.
setMilliseconds method sets the millisecond value of a Date object using local time.
setMinutes method sets the minutes value of a Date object using local time.
setMonth method sets the month of a Date object using local time.
setSeconds method sets the seconds value of a Date object using local time.
setTime method sets the date and time of the Date object.
setUTCDate method sets the numeric date of a Date object using Universal Coordinated Time (UTC).
setUTCFulYear method sets the year of a Date object using Coordinated Universal Time (UTC).
The setUTCHours method sets the hour value of a Date object using Coordinated Universal Time (UTC).
setUTCMilliseconds method sets the millisecond value of a Date object using Coordinated Universal Time (UTC).
setUTCMinutes method sets the minute value of a Date object using Coordinated Universal Time (UTC).
The setUTCMonth method sets the month of a Date object using Coordinated Universal Time (UTC).
setUTCSeconds method sets the seconds value of a Date object using Universal Coordinated Time (UTC).
setYear method uses the year of the Date object.
sin method returns the sine of a number.
slice method (Array) returns a slice of the array.
slice method (String) returns a slice of string. The
small method adds the HTML tag to both ends of the text in a String object.
sort method returns an Array object whose elements are sorted. The
split method splits a string into substrings and returns the result as an array of strings.
sqrt method returns the square root of a number. The
strike method adds the HTML tag to both ends of the text in a String object. The
sub method places the HTML tag at both ends of text in a String object.
substr method Returns a substring starting at the specified position and having the specified length.
substring method Returns the substring at the specified position in the String object. The
sup method places HTML's tags at both ends of text in a String object.
tan method returns the tangent of a number.
test method Returns a Boolean value indicating whether a pattern exists in the string being searched.
toArray method returns a standard JScript array converted from VBArray. The
toGMTString method returns a date converted to a string using Greenwich Mean Time (GMT).
toLocaleString method Returns a date converted to a string using local time.
toLowerCase method Returns a string with all alphabetic characters converted to lowercase letters.
toString method returns the string representation of an object.
toUpperCase method Returns a string with all alphabetic characters converted to uppercase letters. The
toUTCString method returns a date converted to a string using Universal Coordinated Time (UTC).
ubound method Returns the maximum index value used in the specified dimension of the VBArray.
unescape method Decodes the String object encoded with the escape method.
UTC method returns the number of milliseconds between Universal Coordinated Time (UTC) (or GMT) at midnight on January 1, 1970 and the specified date.

valueOf method Returns the original value of the specified object.



$1...$9 property returns the nine most recent records found in the pattern match

arguments property returns an array containing each argument passed to the currently executing function array.
caller attribute returns the function reference that calls the current function.
constructor attribute specifies the function that creates the object. The
description attribute returns or sets a description string about the specified error.
E attribute Returns Euler's constant, the base of natural logarithms. The
index attribute returns the position of the first successfully matched character found in the string.
Infinity property returns the initial value of Number.POSITIVE_INFINITY.
input attribute Returns the string to search for.
lastIndex property returns the last successfully matched character position found in the string.
The length attribute (Array) returns an integer that is 1 greater than the highest element defined in the array.
length attribute (Function) returns the number of parameters defined for the function.
length property (String) returns the length of the String object.
LN2 Property Returns the natural logarithm of 2.
LN10 property Returns the natural logarithm of 10.
LOG2E property Returns the base 2 logarithm of e (i.e. Euler’s constant).
LOG10E property returns the base 10 logarithm of e (that is, Euler's constant).
MAX_VALUE attribute returns the maximum value that can be expressed in JScript.
MIN_VALUE attribute returns the value closest to zero that can be represented in JScript.
NaN attribute (Global) returns the special value NaN, indicating that an expression is not a number.
NaN attribute (Number) returns a special value (NaN), indicating that an expression is not a number.
NEGATIVE_INFINITY attribute Returns a value more negative than the largest negative number that can be represented in JScript (-Number.MAX_VALUE).
number attribute Returns or sets the numeric value associated with a specific error.
The PI attribute returns the ratio of the circumference of a circle to its diameter, which is approximately equal to 3.141592653589793.
POSITIVE_INFINITY attribute returns a value greater than the largest number that can be represented in JScript (Number.MAX_VALUE).
prototype attribute returns the prototype reference of the object class. The
source attribute returns a copy of the text of the regular expression pattern.
SQRT1_2 Property Returns the square root of 0.5, which is the square root of 1 divided by 2.

SQRT2 property returns the square root of 2





The break statement terminates the current loop, or if associated with a label statement, terminates the associated statement .
catch statement A statement that is executed when an error occurs in the code contained in the try statement block.
@cc_on statement activates conditional compilation support.
// (single-line comment statement) causes single-line comments to be ignored by the JScript parser.
/*..*/ (multi-line comment statement) causes multi-line comments to be ignored by the JScript parser. The
continue statement stops the current iteration of the loop and starts a new iteration.
do...while statement first executes the statement block once, and then executes the loop repeatedly until the value of the conditional expression is false.
for statement will execute the statement block as long as the specified condition is true.
for...in statement Execute one or more statements corresponding to each element in the object or array.
function statement declares a new function.
@if statement Conditionally executes a set of statements based on the value of an expression.
The if...else statement conditionally executes a set of statements based on the value of an expression.
Labeled Statement Provides an identifier for the statement. The
return statement exits the current function and returns a value from that function.
@set statement creates variables used in conditional compilation statements.
switch statement When the value of the specified expression matches a certain label, the corresponding one or more statements are executed.
This statement refers to the current object.
throw statement Generates an error condition that can be handled by a try...catch statement.
try statement implements JScript error handling.
var statement declares a variable.
while statement executes the statement until the given condition is false. The

with statement determines the default object of a statement.





Addition operator ( ) adds two numbers or concatenates two strings.

Assignment operator (=) assigns a value to a variable.
The bitwise AND operator (&) performs a bitwise AND operation on two expressions.
The bitwise left shift operator (The bitwise NOT operator (~) performs a bitwise NOT operation on an expression.
The bitwise OR operator (|) specifies a bitwise OR operation on two expressions.
The bitwise right shift operator (>>) shifts the bits of an expression to the right, keeping the sign unchanged.
Bitwise XOR operator (^) performs a bitwise XOR operation on two expressions.
The comma operator (,) causes two expressions to be executed consecutively.
Comparison operator returns a Boolean value representing the comparison result.
Compound assignment operator List of compound assignment operators.
The conditional (ternary) operator (?:) executes one of two expressions based on a condition.
Decrement operator (--) decreases a variable by one.
delete operator deletes an attribute of an object, or deletes an element in an array. .
The division operator (/) divides two numbers and returns a numeric result.
Equality operator (==) compares two expressions to see if they are equal.
The greater than operator (>) compares two expressions to see if one is greater than the other.
The greater-than-equality operator (>=) compares two expressions to see if one is greater than or equal to the other.
The identity operator (===) compares two expressions to see if their values ​​are equal and have the same data type.
The increment operator ( ) adds one to the variable.
The inequality operator (!=) compares two expressions to see if they are not equal.
instanceof operator returns a Boolean value indicating whether an object is an instance of a specific class.
The less than operator (The less than equal operator (Logical AND operator (&&) performs a logical AND operation on two expressions.
Logical NOT operator (!) performs a logical NOT operation on an expression.
The logical OR operator (||) performs a logical OR operation on two expressions.
Modulo operator. (%) Divides two numbers and returns the remainder.
Multiplication operator (*) multiplies two numbers. The
new operator creates a new object.
The inequality operator (!==) compares two expressions to see if they have unequal values ​​or different data types.
Operator Priority A list containing execution priority information for JScript operators.
Subtraction operator (-) performs a subtraction operation on two expressions.
typeof operator returns a string representing the data type of the expression.
The unary negation operator (-) represents the opposite of a numerical expression.
The unsigned right shift operator (>>>) performs an unsigned right shift on the bits in the expression.
void operator prevents an expression from returning a value.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template