Bash
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
// class dd{
// constructor(){
// this.color = '颜色';
// this.size = '尺寸';
// }
// }
// 类的表达式写法(类的另一种(第2种写法))
let a = class dd{
constructor(){
this.color = '颜色';
this.size = '尺寸';
}
}
// let syu = new dd();
let syu = new a();
// 输出结果: 颜色
console.log(syu.color);
</script>
</body>
</html>
原文链接:https://www.qiquanji.com/post/7531.html
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

微信扫码关注
更新实时通知