在JS中定义类的方式有两种
第一种
function 类名(形式参数列表){
this.属性名=参数;
this.方法名=function(){
}
}
第二种
类名= function(形式参数列表){
this.属性名=参数;
this.方法名=function(形式参数列表){
}
}
<html>
<head>
<meta charset="utf-8">
<title></title>