1.面向对象中的 概念
1):一切事物都是对象
2):对象具有封装和继承特性
3):信息隐藏
基本面向对象
var person = {
name:'iwen',
age:30,
eat:function(){
alert("能吃");
}
}
alert(person.name);
函数构造器构造对象
function Person(){
}
// 原型链
Person.prototype = {
name:"iwen",
age:30,
eat:function(){
alert("能吃");
}
}
var person = new Person();
person.eat();