1, Javascirpt contains three aspects:
ECMAJAVASCIRPT: Providing the core language
DOM: Provides a way to access and manipulate page content
BOM: Provides interfaces and methods for interacting with the browser
2. JAVASCIRPT has 6 data types: string, Boolean,number,null,undefined,object, etc.
TypeOf ("23"); // stringtypeOf (23); // number TypeOf (true); // booleantypeOf (null); // objecttypeOf (undefined); // undefinedtypeOf (function() {}); // function
3. There are 3 kinds of loop statements: While statement, Do-while statement, for statement
4. Cast Type: Number (""), parseint (""), Parsefloat ("), Boolean (); It's worth noting that
Number (null);//0number (undefined);//nannumber ({});//nanboolean (1);//trueboolean (0;//falseboolean ("");// Falseboolean (null);//falseboolean (undefined);//falseboolean ("false");//true
Number ("123abc");//nan
parseint ("123abc");//123
5. How to determine whether a property exists in an object
varP1={name: "Lily", age:23}p1.name;//"Lily"P1.ismale://undefined;//This gives you access to the object's properties, which can not be judged by undefined, so take a look at the following codevarP1={name: "Lily", age:undefined} p1.age;//undefined;//the same thing happens when undefined can't use undefined to determine if an object exists.the P1.hasownproperty can only be used in two different ways ("Name");//true"Name"inchP1;//true
6. Any elements that traverse an object
var p1={name: "Lily", age:23}object.keys (p1); // ["Name", "Age"] Object.getownpropertynames (p1); ["Name", "Age"] for (var prop in p1) {console.log (P1[prop]);} // lily,23
JS Learning basic Sharing Summary