Blogger Information
Blog 16
fans 0
comment 0
visits 10782
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
js创建对象方式-2018年9月12日
兔子的博客
Original
514 people have browsed it

js创建对象

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	
</body>
</html>
<script type="text/javascript">
//内置构造函数创建对象
	var a=new Object();
	a.name="aaa";
	a.age="1";
	console.log(a);
	//字面量创建对象
	var b = {};
	b.name="bbb";
	b.age="2";
	console.log(b);
</script>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post