# js数组分为属性和方法
## 属性
1.constructor返回对创建此对象的数组函数的引用。
这个其实在javascript中的对象都有
var a = [] console.log(a.constructor==Array) // true
function a(){ return [] } console.log(a.constructor == Function) // true
说明 constructor属性是对象实际的引用
2.length 属性可设置或返回数组中元素的数目。
这个应该没有什么可以解释的就是数组的长度,是数值型
3.prototype 属性使您有能力向对象添加属性和方法。
属于对象的原型,一般像继承如果当前对象没有访问的方法则会像原型中查找,这里有__proto__指向原型中的原型,还有一个关键词就是检查是否是原型中的函数或属性hasOwnProperty,如果需要更深入的了解可以查找js prototype、__proto__、hasOwnProperty(Internet Explorer 8 和低于其的版本的宿主对象不支持该属性),所有的对象原型链最终都指向Object
## 方法
1.concat() 方法用于连接两个或多个数组。我直接写例子了:
var a = [1,2] var b = [1,3,45] var c = a.concat(b) console.log(a) //[1, 2] console.log(b) //[1, 3, 45] console.log(c) //[1, 2, 1, 3, 45] var d = a.concat(b,c) console.log(d) //[1, 2, 1, 3, 45, 1, 2, 1, 3, 45]