Some JavaScript objects.

Function object:

1, created:

function f(a) {
            alert(a);
        }
 var f=function(a){
            alert(a);
        }

2. Method:

3, attributes:

  1, length: parameter number.

4, features:

  1, may write the parameter type.

  2, an object method, if the name is defined in the same manner, will be covered.

  3, js, call the method with only the method name is related and unrelated to the argument list.

  4, there is a method declaration built hidden objects (arrays): arguments, parameters to encapsulate all practical.

Array object:

1 created.

 var arr1=new Array();
 var arr2=new Array(5);
 var arr3=new Array(1,2,3)

2, features.

  1, js, the variable array element type.

  2, the array length is also variable.

3, method.

  1, join (separator), the elements of the array splice specified as a string delimiter.

  2, push (), an additive element.

Guess you like

Origin www.cnblogs.com/zhangyuhao/p/10927125.html