1, JS basic data type has number, String, number, Null, Undefined, Boolean, there is a complex data type Object,function and array is a derived type of object.
2, typeof used to determine the data type of a given variable,
"Undefined"-this value is undefined
"Boolean"-This value is a Boolean value
"String"-this value is a string
"Number"--this value is numeric
"Object"--this value is an object or null
"Function"-this value is
"NULL"--empty object
3, numeric conversion, number (), parseint (), parsefloat ()
4. Convert to String, toString ().
5. Properties of type Object:
Property |
Meaning |
Constructor |
A function to create the current object is saved |
hasOwnProperty (PropertyName) |
Used to check whether a given property exists in the current object instance |
isPrototypeOf (object) |
Used to check if an incoming object is a prototype of another object |
propertyIsEnumerable (PropertyName) |
Used to check whether a given property can use the For-in statement to enumerate |
toLocaleString () |
Returns a string representation of the object that corresponds to the region of the execution environment |
ToString () |
Returns the string representation of an object |
ValueOf () |
Returns a string, numeric, or Boolean representation of an object |
6, Logic and (&&) and logic or (| | ) is the short-circuit operator, the former if the first is false, then the second judgment will not be made; If the first one is true, then the second one will not be judged.
7, a value and a string to add, the result is a string, 5+ "5", the result is 55.
8. Equality operator (= = =), returns true only if the two operands are equal without conversion.
The non-congruent operator (!==) returns true only if the two operands are not equal without conversion.
Null = = Undefined, the result is true, but null = = = undefined and the result is false.
9, for-in statement, is an accurate iteration of the statement, can be used to enumerate the properties of the object.
for inch expression) Statement For example: for(var in window) { document.write (propname) ;}
"JS Advanced Program Design" of the second