JavaScript Learning Basics

Source: Internet
Author: User

ECMAScript: Translation, core, interpreter;

Dom:document object model Operation Html.document;

typeof A;

Nan and Nan are unequal; isNaN is used to detect;

= = Convert the type first, then the comparison, that is, the implicit type conversion, minus is also;

= = = does not convert type, direct comparison;

Closures: Child functions can use local variables of the parent function;

Hungarian nomenclature: Type prefixes (variable), capitalized (function);

% modulo: seeking remainder;

Trinocular operator?: Condition? Statement 1: Statement 2;

Break: Interrupts the whole;

Continue: Interrupt this time, skip this time;

JSON: Var json with curly braces = {a:12,b:5,c: ' abc '};alert (JSON.A);

When looping, arrays can use either for (Var i=0;i<arr.length;i++) or for (Var i in arr), JSON can only use for (Var i in JSON);

Arguments: variable parameter, indefinite parameter;

var a = new Array (All-in-all) and var a = [All-in-all], recommended to use the right;

var a = [1,2,3];a.push (4); Alert (a)//add;

var a = [1,2,3];a.pop (); Alert (a)//delete the last one;

var a = [1,2,3];a.shift (); Alert (a)//delete the first one;

var a = [1,2,3];a.unshift (2); Alert (a)//added to the head;

var a = [1,2,3];a.splice (, ' a '); Alert (a)//delete the 1th start, the length 2 part, and insert A;

var a = [1,2,3];var B = [4,5,6]; Alert (A.concat (b)); Connection

var a = [1,2,3];a.join ('-'); alert (a);//Add a connector;

var a = [A,z,d,y,d,s,j];a.sort (); alert (a);//Sort, only recognize the string, the number will be invalid;

Str.charat (): Fully compatible take a string one;

The month of JS starts from 0 to 11, week: Sunday is 0, and week 6 is 6;

Offsetleft: Consider location information, such as left, such as margin;

position:relative relative positioning;

Overflow:hidden hidden overflow;

List-style:none list character disappears;

JavaScript Learning Basics

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.