js的对象

<!DOCTYPE html>
<html>
<body>

<script>
person=new Object();
person.firstname="Bill";
person.lastname="Gates";
person.age=56;
person.eyecolor="blue";
document.write(person.firstname + " is " + person.age + " years old.");
</script>

</body>
</html>

首先定义一个对象person,在person下写各个分支

posted @ 2018-08-27 17:06  A-dabai  阅读(117)  评论(0编辑  收藏  举报