<script type="text/javascript">
function number(name,gender){
this.name=name;
this.gender=gender;
this.display =display //指定number 对象的display方法
}
function display(){
var str=this.name + ": " + this.gender;
document.write(str+"<br>");
}
var m1=new number("zhangsan","f")
var m2=new number("lisi","f")
var m3=new number("wangwu","f");
m1.display();
m2.display();
m3.display();
</script>