Consolidation review-JavaScript

Source: Internet
Author: User

First section:

onmouseover    // events, mouse move in;onmouseout    // events, mouse out;= value;    // Element Property operation mode One, through the point (.) way, do not assign value to read;

Section II:

Obj.[arr] = value;    // element attribute operation mode Two, arr is generally a string type, which needs to be enclosed in quotation marks (' ') in actual use; className     // in JS, you cannot use class to get and manipulate the property directly; style     // gets and modifies the inline style, which may overwrite the classname style; window.onload     //meaning executes after the page is loaded;
InnerHTML //Read or set all content within the tag element;

/* Flexible use of JS to add and use inline index values */ /* Cannot read style or set style for an array, bind event operation, generally need to use the loop */

Section III:

typeof    //gets the data type, including: Number, String, Boolean, undefined, object, function six class;parseint ()//coercion type conversion, converts the value of the variable to an integer type;parsefloat ()//coercion of type conversions, conversion of variable values to floating-point type;NaN//is a number type, but not equal to any numbers (including itself);%//Modulo is a useful arithmetic operator, which can be used to take single-or even-numbered, infinite-loop arrays.%=//obtains the remainder and assigns the remainder to the variable;true    //includes true, non-0 numbers, non-empty strings, non-empty objects;false    //Includes false, undefined, number 0, empty string, empty object;

/*coercion type conversion is also known as the explicit type conversion, which corresponds to the automatic type conversion, also known as the implicit type conversion, for example, when using double equals (= =), one side data type will be compared with the other side of the conversion, as well as subtraction calculation, etc.*/
/ * about JSON object: The JSON object wraps the data using curly braces ({}), saves the data using Key:value, the key value resembles the subscript of the array, but it does not have the length property, and traversing the data requires the use of the For In loop * /

Section Fourth:

Arguments//called an indefinite parameter or variable parameter, is the default parameter of a function, and is used to determine the number of parameters by using its Length property.Obj.currentstyle[attr]//the current final style of operation elements (both inside and outside the line), only applicable to IE;getComputedStyle (obj, pseudoclass) [attr]//read-only, get the elements after the completion of the calculation of the style (both inside and outside the line), for Firefox and Chrome, the pseudo-class part of the parameters can be filled with arbitrary values;Arrobj.length//the length of the array can be obtained, or can be modified after the definition of the array, if it is smaller than the initial, will discard the extra length corresponding data, this attribute can be used to empty the array;concat (Arrx, Arrx, ..., Arrx)//merging multiple arrays;Join (separator)//joins the data in the array with the specified string and converts it to a string, which defaults to a comma (,) number;push (NEWX)//add data from the tail and return the new length;unshift (NEWX)//add data from the head and return the new length;pop ()//deletes and returns the last element of the array;shift ()//deletes and returns the first element of the array;Splice (index, Howmany, Item1, ..., ItemX)//The parameter is to start from a subscript, delete several, the data to insert, can use this method to complete delete, add and replace operation;sort (sortby)//sort the data within an array, sort by string when no parameter, first uppercase and lowercase, and number as String, with the parameter Sortnumber in ascending order of numeric literal size;Sort (function(N1, N2) {//Use the comparison function to let the sort method order the actual size of the numbers;    returnN1-n2//ascending n1-n2, descending n2-n1;});

Consolidating review-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.