真数组与伪数组的区别

 1:真数组的长度是可变的,伪数组的长度不可变
* 2:真数组可以使用数组中的方法(.forEach),伪数组不可以
* 3:真数组可以使用原型辨别,伪数组没有__proto__和prototype


//复习创建对象的三种方式
* 1: 字面量的方式
* 2:调用系统的函数构造
* 3:自定义构造函数
//实例对象
var per1={
name:"卡卡西",
age:20,
sex:"男",
eat:function () {
console.log("喜欢吃拉面");
},
readbook:function () {
console.log("喜欢看小说");
}
};

//调用系统的函数构造
var per2=new Object();
per2.name="鸣人";
per2.age=16;
per2.sex="男";
per2.eat=function () {
console.log("喜欢吃拉面");
};
per2.play=function () {
console.log("喜欢调皮捣蛋");
};

//自定义构造函数
function person(name,age,sex) {
this.name=name;
this.age=age;
this.sex=sex;
this.play=function () {
console.log("喜欢打游戏");
};
}
var person=new person("鹿丸",16,"男")
原文地址:https://www.cnblogs.com/lujieting/p/10082552.html