In JavaScript, objects usually include two types: built-in objects and browser objects. In addition, users can also customize objects.
An object contains two features:
1. A set of data used to describe the properties of an object, that is, several variables, usually called attributes.
2. Several actions used to operate object characteristics, that is, several functions, are usually called methods.
| Object | meaning |
| anchor | The hyperlink with the name attribute set in the current document |
| applet | Mini programs in the current document |
| Area | Areas in client graphics map |
| button | Buttons in the form |
| checkbook | Checkboxes in the form |
| document | HTML document in the current window |
| Embed | Embed object in the current window |
| event | Events occurring in the browser |
| fileUpload | File selection box in the form |
| form | Forms in the current document |
| frame | Frame in the current window |
| Hidden | Hide fields in the form |
| history | The history of the URL visited by the browser |
| image | Graphics files in the current document |
| link | Hyperlink with href attribute set in the current document |
| location | The URL of the browser currently displays the web page |
| mimeType | Information on specific MIME types supported by the browser |
| navigator | Current browser |
| option | Options for the Options menu in the form |
| password | Password box in form |
| plugin | Plugins in the current browser |
| radio | Radio box in form |
| reset | Reset button in form |
| screen | User screen |
| select | Options menu in the form |
| Submit | Submit button in form |
| text | Single line text box in form |
| textarea | Multi-line text box in a form |
| window | A frame in a browser window or window |
Built-in objects
1.Array object; 2.Boolean object; 3.Date object; 4.Math object; 5.Number object; 6.Object object; 7.RegExp object; 8.String object; 9.Global object; 10.Function object
1. Array object is an array object. Array elements can not only make other data types, but also other arrays or objects.
| constructor | Returns a reference to the array function that created this object. |
| index | |
| input | |
| length | Sets or returns the number of elements in the array. |
| concat() | Concatenate two or more arrays and return the result. |
| join() | Put all elements of the array into a string. Elements are separated by specified delimiters. |
| pop() | Delete and return the last element of the array |
| push() | Add one or more elements to the end of the array and return a new length. |
| reverse() | Reverse the order of elements in the array. |
| shift() | Delete and return the first element of the array |
| slice() | Returns the selected element from an existing array |
| sort() | Sort the elements of the array |
| splice() | Delete the element and add new elements to the array. |
| toSource() | Returns the source code of the object. |
| toString() | Convert the array to a string and return the result. |
| toLocaleString() | Convert the array to a local array and return the result. |
| unshift() | Add one or more elements to the beginning of the array and return a new length. |
| valueOf() | Returns the original value of the array object |
2. The Boolean object can access the Boolean value as an object and change the parameter to a Boolean value.
| Boolean object properties | describe |
| constructor | Returns a reference to the Boolean function that created this object |
| prototype | Add properties and methods to objects |
| Boolean object method | describe |
| toSource( ) | Returns the source code of the object. |
| toString( ) | Convert the logical value to a string and return the result |
| valueOf( ) | Returns the original value of the Boolean object. |
3.Date object is used to process dates and times.
| Date object properties | describe |
| constructor | Returns a reference to the Date function that created this object. |
| prototype | Gives you the ability to add properties and methods to objects. |
| Date() | Returns the date and time of the day. |
| getDate() | Returns a day of the month from the Date object (1 ~ 31). |
| getDay() | Returns a day of the week from the Date object (0 ~ 6). |
| getMonth() | Returns month (0 ~ 11) from Date object. |
| getFullYear() | Returns the year as four digits from the Date object. |
| getYear() | Please use the getFullYear() method instead. |
| getHours() | Returns the hours of the Date object (0 ~ 23). |
| getMinutes() | Returns the minutes of the Date object (0 ~ 59). |
| getSeconds() | Returns the number of seconds (0 ~ 59) of the Date object. |
| getMilliseconds() | Returns milliseconds (0 ~ 999) of the Date object. |
| getTime() | Returns the number of milliseconds from January 1, 1970 to present. |
| getTimezoneOffset() | Returns the minute difference between local time and Greenwich Standard Time (GMT). |
| getUTCDate() | Returns the day of the month from the Date object according to the world time (1 ~ 31). |
| getUTCDay() | Returns the day of the week from the Date object according to the world time (0 ~ 6). |
| getUTCMonth() | Returns month from Date object according to world time (0 ~ 11). |
| getUTCFullYear() | Returns a four-digit year from a Date object based on world time. |
| getUTCHours() | Returns the hour (0 ~ 23) of the Date object according to the world time. |
| getUTCMinutes() | Returns the minutes of the Date object (0 ~ 59) according to the world time. |
| getUTCSeconds() | Returns the seconds of the Date object (0 ~ 59) based on world time. |
| getUTCMilliseconds() | Returns milliseconds of the Date object (0 ~ 999) based on world time. |
| parse() | Returns the number of milliseconds from midnight on January 1, 1970 to the specified date (string). |
| setDate() | Sets a certain day of the month in the Date object (1 ~ 31). |
| setMonth() | Sets the month (0 ~ 11) in the Date object. |
| setFullYear() | Sets the year (four digits) in the Date object. |
| setYear() | Please use the setFullYear() method instead. |
| setHours() | Sets the hours (0 ~ 23) in the Date object. |
| setMinutes() | Sets the minutes (0 ~ 59) in the Date object. |
| setSeconds() | Sets the seconds (0 ~ 59) in the Date object. |
| setMilliseconds() | Sets the milliseconds (0 ~ 999) in the Date object. |
| setTime() | Sets the Date object in milliseconds. |
| setUTCDate() | Set the day of the month in the Date object according to the world time (1 ~ 31). |
| setUTCMonth() | Set the month (0 ~ 11) in the Date object according to the world time. |
| setUTCFullYear() | Set the year (four digits) in the Date object according to world time. |
| setUTCHours() | Set the hours (0 ~ 23) in the Date object according to the world time. |
| setUTCMinutes() | Set the minutes in the Date object according to the world time (0 ~ 59). |
| setUTCSeconds() | Set the seconds in the Date object according to the world time (0 ~ 59). |
| setUTCMilliseconds() | Set milliseconds in the Date object according to world time (0 ~ 999). |
| toSource() | Returns the source code of the object. |
| toString() | Converts the Date object to a string. |
| toTimeString() | Converts the time part of the Date object to a string. |
| toDateString() | Converts the date part of the Date object to a string. |
| toGMTString() | Please use the toUTCString() method instead. |
| toUTCString() | Convert the Date object to a string based on the world time. |
| toLocaleString() | Convert the Date object to a string according to the local time format. |
| toLocaleTimeString() | Convert the time part of the Date object to a string according to the local time format. |
| toLocaleDateString() | Convert the date part of the Date object to a string according to the local time format. |
| UTC() | Returns the number of milliseconds from January 1, 1997 to the specified date according to the world time. |
| valueOf() | Returns the original value of the Date object. |
4. Math objects are used for mathematical calculations. Math objects can be used without using constructors, and all properties and methods are static.
| E | Returns the arithmetic constant e, that is, the base number of the natural logarithm (approximately equal to 2.718). | 1 | 3 |
| LN2 | Returns the natural logarithm of 2 (approximately equal to 0.693). | 1 | 3 |
| LN10 | Returns the natural logarithm of 10 (approximately equal to 2.302). | 1 | 3 |
| LOG2E | Returns the logarithm of e with base 2 (approximately equal to 1.414). | 1 | 3 |
| LOG10E | Returns the logarithm of e with base 10 (approximately equal to 0.434). | 1 | 3 |
| PI | Returns Pi (approximately equal to 3.14159). | 1 | 3 |
| SQRT1_2 | Returns the reciprocal of the square root that returns 2 (approximately equal to 0.707). | 1 | 3 |
| SQRT2 | Returns the square root of 2 (approximately equal to 1.414). | 1 | 3 |
| abs(x) | Returns the absolute value of the number. | 1 | 3 |
| acos(x) | Returns the inverse cosine value of the number. | 1 | 3 |
| asin(x) | Returns the inverse sine value of the number. | 1 | 3 |
| atan(x) | Returns the arctangent value of x as a value between -PI/2 and PI/2 radians. | 1 | 3 |
| atan2(y,x) | Returns the angle from the x-axis to point (x,y) (between -PI/2 and PI/2 radians). | 1 | 3 |
| ceil(x) | Round up the logarithm. | 1 | 3 |
| cos(x) | Returns the cosine of the number. | 1 | 3 |
| exp(x) | Returns the index of e. | 1 | 3 |
| floor(x) | Round down the logarithm. | 1 | 3 |
| log(x) | Returns the natural logarithm of the number (bottom is e). | 1 | 3 |
| max(x,y) | Returns the highest value in x and y. | 1 | 3 |
| min(x,y) | Returns the lowest value in x and y. | 1 | 3 |
| pow(x,y) | Returns the y power of x. | 1 | 3 |
| random() | Returns a random number between 0 and 1. | 1 | 3 |
| round(x) | Round the number into the closest integer. | 1 | 3 |
| sin(x) | Returns the sine of the number. | 1 | 3 |
| sqrt(x) | Returns the square root of the number. | 1 | 3 |
| tan(x) | Returns the tangent of the angle. | 1 | 3 |
| toSource() | Returns the source code of the object. | 1 | - |
| valueOf() | Returns the original value of the Math object. | 1 | 4 |
5. The Number object can be accessed as an object, just like Math, without creating an object, use it directly.
| constructor | Returns a reference to the Number function that created this object. | 1.0 | 4.0 |
| MAX_VALUE | The largest number that can be represented. | 1.0 | 4.0 |
| MIN_VALUE | The smallest number that can be represented. | 1.0 | 4.0 |
| NaN | Non-numeric value. | 1.0 | 4.0 |
| NEGATIVE_INFINITY | Negative infinity, returns this value when overflowing. | 1.0 | 4.0 |
| POSITIVE_INFINITY | It is infinity and returns this value when overflowing. | 1.0 | 4.0 |
| prototype | Gives you the ability to add properties and methods to objects. | 1.0 | 4.0 |
| toString | Converts the number to a string, using the specified cardinality. | 1.0 | 4.0 |
| toLocaleString | Convert numbers to strings, using local numeric format order. | 1.0 | 4.0 |
| toFixed | Converts a number into a string, and the result has a number of specified digits after the decimal point. | 1.0 | 5.5 |
| toExponential | Converts the object's value to exponential counting method. | 1.0 | 5.5 |
| toPrecision | Format the number to the specified length. | 1.0 | 5.5 |
| valueOf | Returns the basic numeric value of a Number object. | 1.0 | 4.0 |
6. Object objects are objects that derive all other objects, and their properties and methods can be derived from all other objects.
| property | describe |
| constructor | Name of the constructor representing the object |
| prototype | Used to add new properties and methods to objects |
| method | describe |
| toString( ) | Convert an object to be represented by a string |
| valueOf( ) | Get the original value of the specified object |
7. The RegExp object represents a regular expression, which is a powerful tool for performing pattern matching on strings. slightly...
8.String object is used to process text (string).
| constructor | Reference to the function that created the object | 1 | 4 |
| length | The length of the string | 1 | 3 |
| prototype | Allows you to add properties and methods to objects | 1 | 4 |
| anchor() | Create an HTML anchor. | 1 | 3 |
| big() | Display strings in large fonts. | 1 | 3 |
| blink() | Shows the flashing string. | 1 | |
| bold() | Display strings in bold. | 1 | 3 |
| charAt() | Returns the character at the specified position. | 1 | 3 |
| charCodeAt() | Returns the Unicode encoding of the characters at the specified location. | 1 | 4 |
| concat() | Connect string. | 1 | 4 |
| fixed() | Displays strings in typewriter text. | 1 | 3 |
| fontcolor() | Use the specified color to display the string. | 1 | 3 |
| fontsize() | Use the specified size to display the string. | 1 | 3 |
| fromCharCode() | Create a string from character encoding. | 1 | 4 |
| indexOf() | Search string. | 1 | 3 |
| italics() | Use italics to display the string. | 1 | 3 |
| lastIndexOf() | Search for strings from back to front. | 1 | 3 |
| link() | Displays the string as a link. | 1 | 3 |
| localeCompare() | Compare two strings in a locally specific order. | 1 | 4 |
| match() | Find a match for one or more expressions. | 1 | 4 |
| replace() | Replace substrings that match the regular expression. | 1 | 4 |
| search() | Searches the value that matches the regular expression. | 1 | 4 |
| slice() | Extracts fragments of the string and returns the extracted part in the new string. | 1 | 4 |
| small() | Use small font size to display strings. | 1 | 3 |
| split() | Split the string into a string array. | 1 | 4 |
| strike() | Use strikethrough to display strings. | 1 | 3 |
| sub() | Display the string as a subscript. | 1 | 3 |
| substr() | Extract the specified number of characters from the string from the starting index number. | 1 | 4 |
| Substring() | Extracts the character between two specified index numbers in the string. | 1 | 3 |
| sup() | Display the string as a superscript. | 1 | 3 |
| toLocaleLowerCase() | Convert string to lowercase. | - | - |
| toLocaleUpperCase() | Convert string to uppercase. | - | - |
| toLowerCase() | Convert string to lowercase. | 1 | 3 |
| toUpperCase() | Convert string to uppercase. | 1 | 3 |
| toSource() | The source code representing the object. | 1 | - |
| toString() | Returns the string. | - | - |
| valueOf() | Returns the original value of a string object. | 1 | 4 |
10. Function objects can access functions as objects and can generate and call functions dynamically during script execution.
| property | describe |
| arguments | Array of function parameters |
| Caller | Indicates calling the currently executing function |
| prototype | Add new properties and methods to objects |
| method | |
| apply() | Used to apply methods in one object to another |
| call(this); call(this,arg1,arg2...) | A method that allows calling another object |
| toString | Used to convert an object into a string |
The above article briefly discusses the built-in objects and browser objects of JavaScript are all the content I have shared with you. I hope you can give you a reference and I hope you can support Wulin.com more.