1.Object objects
Prototype Object
A prototype is an attribute of an object, which is the prototype attribute, and each object has this intrinsic property, and he is an object in itself.
<script type= "Text/javascript" >
object.prototype.num=;
Alert ("Add a Prototype Object attribute:" + object.num);
Object.num =;
Alert ("Add object attribute:" +object.num);
</script>
Prototype chain
Object.prototype.a = 3.14;
Alert ("Instance of object:" + New Object (). a);
Alert ("Properties of String object:" + string.a);
Analysis: When the object's prototype is extended, it is the equivalent of objects. Prototype, which means that all local objects have properties of this object, because all local objects inherit from the object, so string also has the value of property A.
2.Function objects
Arguments objects
When a function executes, the system automatically creates a arguments object property for the function object, arguments the object property, can only be used in the function body, and uses to manage the actual parameters of the function.
(1) Caller property
The caller property shows the caller of the function, so the following example calls Function B (), and the call function B is null;
<script type= "Text/javascript" >
var a = new Function ("Alert (' A: ' +a.caller)");
Function B ()
{
A ();
Alert (' B: ' +b.caller);
}
b ();
</script>
(2) Length property
Length is a property of the arguments object that represents the number of arguments passed when a function is invoked, and can be accessed by an array of actual parameters.
function argc ()
{
alert (arguments[0]+arguments[1]+arguments[3]);
}
ARGC (1,2,3);
Run result is 6