首页 期权学习期权知识正文

类的表达式写法2种写法

xiaojiucai 期权知识 2020-08-18 623 0
<!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

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。