//匿名函数
var d = function(i1,i2){return i1+i2;}
//类:javascript中没有类的语法,是用函数闭包(closure)模拟出来的。
function Person(name,age){
this.name=name;
this.age = age;
this.SayHello = function(){
alert("你好,我是"+this.name+",我"+this.age+"岁");
}
}
var p1 = new Person("tom",20);
p1.SayHello();