Prototype definition
- Each object has a prototype
- The prototype is still an object
- Simulating the implementation of object-oriented inheritance
Prototype chain
- The prototype of the object is also a prototype
- Objects can inherit properties on the prototype in addition to their own properties
Get prototypes
- Object. Proto
- constructor. prototype
Properties of the manipulation prototype
- The prototype itself is the object, the same object as the operand
Determines whether a property is self-contained or a prototype inherits
Create an object in ECMA5 and specify the object's prototype
Boolean Creation method
- Direct amount Var b=true;
- Conversion function Var B1=boolean (true);
- constructor var b2=new Boolean (False)
Property
- Constructor return Object type
Method
- ToString () turns the Boolean value to a string and returns the result
- ValueOf () returns the original value
Number Creation Method
- Direct volume
- Conversion functions
- constructor function
Property
- Number.MAX_VALUE
- Number.min_value
Method
- ToFixed () retains decimals for the specified number of digits, reserved integers by default
- Toexponential () is expressed in the form of scientific notation.
- ToString () is converted to a string. You can convert decimal to any binary string
How string is created
- Direct volume
- Conversion functions
- constructor function
Property
Method
- CharAt (index) returns the character at the specified position, which can be substituted with the [] operator
- charCodeAt (Index) returns the encoding of the character at the specified position
- String.fromCharCode () converts Unicode encoding to characters
- Concat () joins one or more strings, which can be replaced by the + operator
- IndexOf () returns the position of the first occurrence of a character (string) in a string
- LastIndexOf () returns the position of the last occurrence of a character (string) in a string
- SUBSTR (start [, length]) intercepts the string
- SUBSTRING (start [, end]) intercepts the string
- Slice () with substring
- Split () splits a string into an array of root arrays in the same way Arr.join () opposite
- toUpperCase () Converts a string to uppercase
- toLowerCase () Converts a string to lowercase
- Trim () Remove spaces on both sides of the string
- Replace ()
- Match ()
- Search ()
Date Creation Date
- constructor var date=new date ()
Method
- GetYear ()
- getFullYear () A.D.
- GetMonth () starting from 0
- GetDay () Day (days of the week)
- GetDate () Day (date)
- GetHours ()
- Getminutes ()
- Getseconds ()
- Getmilliseconds () MS
- GetTime () from January 1, 1970 0:0 0 seconds to present the number of milliseconds
- getTimezoneOffset () The offset unit of the standard Time zone is the minute
- getUTCHours () Standard Time zone
- Getutc .....
- setUTCHours ()
- Set ...
- SETUTC ...
- TOUTCSTIRNG ()
Time stamp
- Number of seconds or milliseconds since the beginning of Unix
- Unix 1970
Math Property
Method
- ABS () to find absolute value
- sqrt () to find the square root
- Pow () to ask several Parties
- Max () to find the maximum value
- Min () to find the minimum value
- Round () rounded rounding
- Floor () Rounding and rounding
- Ceil () into a rounding
- Random () returns the decimal number between 0~1
JavaScript prototypes and built-in objects 1