Basics of JavaScript

Source: Internet
Author: User
Tags local time natural logarithm object object root math serialization square root string indexof

(function () {Global attribute infinity means that the value of positive infinity is Nan means values that are not numeric undefined undefind value global function decodeURI () decoding using encodeURI () Escaped string decodeuricomponent () decoding using encodeURIComponent () escaped string encodeURI () Encode the URI by escaping a specific character encodeuricomponent by escaping the component encoding of the URI for a particular character escape () to replace a specific character with an escape sequence and execute a JavaScript code string with the string encoding eval (). Returns the result Isfinite () determines whether a value is infinitely large isNaN () determines whether a value is a non-numeric parsefloat () parsing the value from a string parseint () parsing an integer from the string unescape () decoding using Escape ()  The encoded string Global object Arrayarray () constructor Booleanboolean () constructor Datedate () constructor Errorerror () constructor Evalerrorevalerror () constructor function The function () constructor JSON refers to an object that defines the functions JSON = Jsonobj for parsing and serializing JSON; Math refers to an object that defines the math function math = mathobjnumbernumber () constructor Objectobject () constructor Rangeerrorrangeerror () Constructor Referenceerrorreferenceerror () constructor Regexpregexp () constructor stringstring () constructor Syntaxerrorsyntaxerror () The constructor Typeerrortypeerror () constructor Urierrorurierror () constructor Mathmath.ceil () takes a number up rounding Math.float (num) to a number down-rounding Math.Round () Rounding Math.random () calculates a random number Math.max () returns the two number of the larger of the Math.min () returns the smaller of the two digits of the math.abs (num) calculation absolute value Math.acos () calculates the inverse cosine math.asin () calculates the inverse sine value math.atan () calculates the inverse tangent value math.atan2 () calculates the angle from the x-axis to the specified point of math.cos () computes the cosine of Math.exp () calculates the Math.log () of the exponent of E () computes the natural logarithm Math.pow () calculates the Y-square math.sin () of x to calculate the sine of math.sqrt () to calculate the square root Math.tan () Calculates the tangent numbernumber.tolocalestring () converts a number to a locally formatted string number.toprecision () formats a number of valid digits number.tostring () Converts a number to a string number.valueof () returns the original numeric value Objecthasownproperty () checks whether the object has a local definition of the specified name (rather than the inheritance) of the property isprototypeof () Checks whether the current object is a prototype of a specified object propertyIsEnumerable () checks if a property of the specified name exists and can be enumerated with for/in Loop tolocalestring () returns a localized string representation of the object ToString () Returns a string representation of the object valueof () returns the original value of the current object, and if the original value exists, the static method Object.create () Creates a new object with the specified prototype and attributes Object.defineproperties () Creates or configures one or more properties of the specified object Object.defineproperty () creates or configures a property of the specified object Object.freeze () Sets the specified object to immutable Object.getownpropertydescriptor () queries the attribute of the specified property of the specified object Object.getownpropertynames () returns an array containing all the names of the non-inherited properties of the specified object. Include non-enumerable property object.getprototypeof () returns the prototype of the specified object Object.isextensible () checks whether the current object can be added to the new property Object.isfrozen () Checks whether the current object is frozen object.issealed () checks whether the specified object is closed (sealed) Object.keys () returns an array containing all the non-inheritable enumerable property names of the specified object object.preventextensions () prevents adding a new property to the specified object Object.seal () prevents the addition of a new property to the specified object or removes an existing property Stringcharat () takes a character from the specified position in a string charCodeAt () returns the character at the specified position in a stringThe Encoding concat () links one or more values into a string indexof () looks for a character or substring in the specified string LastIndexOf () looks backwards in the specified string for a character or substring localecompare () Compare strings using a locally defined order match () use regular expressions to perform pattern matching replace () use regular expressions to perform find and replace operations search () finds substrings in a string that match a regular expression slice () A slice or substring of the returned string split () breaks at the specified delimiter string or regular expression, splits a string into an array of strings substr () extracts a substring of a string, a variant of substring () substring () Extracts a substring of a string toLowerCase () returns a copy of the specified string, where all characters have been converted to lowercase ToString () to return the original string value toUpperCase () returns a copy of the specified string. All of the characters have been converted to uppercase trim () to return a copy of the specified string, where both front and back whitespace characters have been removed valueof () returns the original string value of the static method String.fromCharCode () Creates a new string using the character encoding passed in as a parameter Arrayconcat () joins the element into the array every () tests whether the assertion function is true for each array element () returns an array element that satisfies the assertion function, foreach () Calls the specified function for each element of the array indexof () finds a matching element in the arrays join () converts all elements of the array into strings and joins together LastIndexOf () finds a map () in the direction of the array to find the new array element from the elements of the array pop () Move the last element of the array push () adds the element to the end of the arrays reduce () from the elements of the array, calculates a value reduceright () from right-to-left reduced array reverse () reverses the order of the array elements in the original array shift () Move the first element of the slice () returns part of the array some () tests whether there is at least one array element that enables the assertion function to sort the array elements in the original array splice () Insert, delete, or replace the elements of the arrays tolocalestring () Converts an array to a localized string toString () converts an array to a string unshift () in the array header insert element booleanboolean.tostring () converts a Boolean value to a string boolean.valueof () returns a Boolean value of theThe original value, Functionapply (), invokes the function as a method of the specified object. Passed to it is the specified array of arguments to bind () to return a new function. Calls the method call () as a method of the specified object, by specifying the parameter in the optional, call () to invoke the function as a method of the specified object. Passed to it is the specified parameter, tostring () returns the string representation of the function dategetdate () returns the date value in the month of the date object, local or World time Getday () returns the date value in the week of the Date object, getFullYear () Returns the year of the date, the full 4-digit format gethours () returns the value of the Date object, Getmilliseconds () returns the milliseconds of the Date object, getminutes () returns the minute value of the Date Object GetMonth () Returns the month value of the Date object Getseconds () returns the second value of the Date object GetTime () returns the internal millisecond representation of the date object. Note that this value is independent of the time Zone getTimezoneOffset () returns the number of minutes between the local representation of the current date and the UTC representation. Note The return value depends on the specified date when daylight saving time is valid setdate () sets the date of the month's date value setfullyear () sets the date of the year (and the optional month and date) value sethours () Setting the date's time-out (and optional minutes, seconds, and millisecond values) Setmilliseconds () sets the millisecond value of the date setminutes () sets the minute value of the date (as well as the selectable seconds and millisecond values) setmonth () sets the month value of the date (and the number of days in the optional month) setseconds () sets the second value of the date ( and an optional millisecond value) settime () sets the value of a Date object using the format of milliseconds todatestring () returns a String representing the date part of the current date toisostring () converts a date to a string. Use the ISO-8601 standard to combine date/time formats and Utctojson () to return a Date object JSON serialization toLocaleDateString () returns a String representing the day part of the current date tolocalestring () Converts a date to a string tolocaletimestring () returns a string representing the time portion of the current date ToString () converts a date to a string using the local time zone totimestring () Returns a String representing the time portion of a specified date toutcstring () converts a date to a string valueof (Converts a date to the corresponding internal millisecond format static method Date.now () returns the current time, the number of milliseconds since the beginning of the era date.parse () resolves a string representation of a date and time, and returns the internal milliseconds of the date represented by DATE.UTC () Returns the millisecond of the specified UTC date and time in Jsonjson.parse () parsing the JSON-formatted string json.stringify () serialization object, array, or original value Bomdom}) ();

  

Basics of JavaScript

Related Article

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.