1. Each function object has a Length attribute, indicating the parameter format that the function expects to receive.
Unlike the arguments of the function, arguments. Length indicates the parameter format actually received by the function.
2. There are five original data types in javascript: undefined, null, Boolean, number, and string.
3. The undefined data type has only one value: undefined.
4. The NULL data type has only one value: null.
5. boolean data types include true and false.
6. There is no char data type in JavaScript.
7. typeof is a unary operator followed by the variable name. It is used to obtain the data type of the variable,
The returned values include undefined, Boolean, number, string, and object.
8. In JavaScript, if the function does not declare the return value, undefined is returned.
9. Relationship between null and undefined: Undefined is actually derived from null.
10. Forced type conversion: There are three types of forced type conversion in javascript:
Boolean (value), number (value), string (value ).
11. In JavaScript, for variables defined in the function, adding var indicates local variables, and without var indicates global variables.
12. In JavaScript, all objects are inherited from object objects.
Properties in the object cannot be enumerated (propertyisenumerable returns false), so it cannot
Through... In statement.
13. In JavaScript, You can dynamically add or delete object attributes.
VaR object = new object ();
// Alert (object. username );
Object ["username"] = "shengsiyuan ";
Alert (object. username );
Delete object. Username; // The username attribute has been deleted from the object.
Alert (object. username );
14. The second method for defining objects in javascript:
// The most common way to define objects in Javascript
VaR object = {Username: "zhangsan", password: 123 };
Alert (object. username );
Alert (object. Password );
15. For the sort method of JavaScript array,
It will first convert the content to be sorted into a string (call the tostring () method ),
Sort strings sequentially.
16. Anonymous Functions
VaR array = [1, 3, 25];
// Anonymous Function
Array. Sort (function (num1, num2)
{
VaR temp1 = parseint (num1 );
VaR temp2 = parseint (num2 );
If (temp1 <temp2)
{
Return-1;
}
Else if (temp1 = temp2)
{
Return 0;
}
Else
{
Return 1;
}
}
);
Alert (array );